I have a model called extra. Here how it looks like;
#<Extra id: nil, name: nil, price: nil, per: nil, compulsory: nil, online_payment: nil, payment_per_person: nil, is_included: nil, created_at: nil, updated_at: nil, user_id: nil>
I would like to first sort them by is_included where it is true. Then I want to sort where compulsory is true, lastly where compulsory is false. Then I want to combine them.
Basically, I want to group them because user can save them unordered. Then remove if anyone exists twice.
Shall I do it on the view or before_save callback?
Thanks