basic-scopes
ActiveRecord basic scopes.
Usage
You can use basic-scopes just as normal ActiveRecord methods.
Filtering
except_ids(ids)- all records without matchingIDfieldfilter_ids(ids)- all recorth with matchingIDfieldfilter_updated_since(time)- all records that haveUPDATED_ATfield greater thantimefilter_updated_till(time)- all records that haveUPDATED_ATfield lesser thantimefilter_created_since(time)- all records that haveCREATED_ATfield greater thantimefilter_created_till(time)- all records that haveCREATED_ATfield lesser thantime
NOTE: ids param can be single ID or Array of IDs
Sorting / OrderBy
by_id- order byIDdescendingby_id_reversed- order byIDascendingby_created_at- order byCREATED_ATdescendingby_created_at_reversed- order byCREATED_ATascendingby_updated_at- order byUPDATED_ATdescendingby_updated_at_reversed- order byUPDATED_ATascending
Example
User.filter_last_update(1.day).by_updated_at - All users updated in the last one day, ordered by time



