Project

easy_arel

0.0
No commit activity in last 3 years
No release in over 3 years
Shorthand references to `arel_table` in ActiveRecord for lazy people, like me.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Easy Arel

With EasyArel instead of:

Thing.arel_table[:created_at]

you can say

Thing[:created_at]

EasyArel also creates class & instance methods named _ that reference your class, So in your model you can be all like

scope :recent, order(_[:created_at].desc)

You can't just use the brackets in this case, because that would just be an array. It's stupid, but I didn't feel like experimenting with any crazy operator overloading. I'm open to suggestions on making this better.

I doubt this is even a good idea, but whatever, tests pass.