Project

eel

0.0
No commit activity in last 3 years
No release in over 3 years
It is more like Squeel but without Squ
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Eel Build Status

This is a small AR extension created to unleash the power of Arel and make it visually suitable for every day usage.

Examples:

# you can use any Arel predicate: eq not_eq gt gteq lt lteq in not_in, etc.
User.where(['age > ?', x]) # AR
User.where(User.arel_table[:age].gt x) # Arel with AR
User.where(:age.gt x) # Eel with AR
# or you can combine more than one column in one statement
User.where('created_at > updated_at') # AR
User.where(User.arel_table[:created_at].gt(User.arel_table[:updated_at])) # Arel with AR
User.where(:created_at.gt :updated_at.attr) # Eel with AR
# sql logical operands are acceptable
User.where(['age > ? OR role = ?', x, 'admin']) # AR
User.where(User.arel_table[:age].gt(x).or(User.arel_table[:role].eq('admin'))) # Arel with AR
User.where(:age.gt(x).or(:role.eq 'admin')) # Eel with AR

You can see it is just Arel but with a little bit of syntactic sugar.