On Oct 14, 1:35 pm, Nate Wiger <[email protected]> wrote:
> Is there a "default_scope" equivalent?
>
> We use that alot of places to sort by date desc, or name asc, or
> something else where we don't want to have to put it everywhere.
Just create your own dataset method and use that to start with.
class Account < Sequel::Model
def_dataset_method(:standard) do
order(:date.desc)
end
end
active_admins = Account.standard.active.admin ...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---