ruby - How can I do a default scope in rails 4? -
this question has answer here:
- rails 4 default scope 8 answers
i used default_scope :order => 'group_name' because wanted uses.
this doesn't work in rails 4
i tried
scope :default, -> { order('group_name')} which didn't raise syntax error, didn't work - groups not ordered name
i can add scope i'd know if there's replacement default.
should declared
default_scope {order('group_name')}
Comments
Post a Comment