How can I get ActiveRecord::Relation object of the model without any conditions? Of cause I can write
User.where # without any args
, but thats looks confusing
How can I get ActiveRecord::Relation object of the model without any conditions? Of cause I can write
User.where # without any args
, but thats looks confusing
User.scoped will do it. All methods like where, order, limit, etc. are delegated to scoped. Calling it directly gives you the bare Relation.