Re: [Rails] Ensure that only one member of a collection has the "current" flag set
On 29 August 2012 16:13, Walter Lee Davis <waltd@wdstudio.com> wrote:
> I have a model that includes a :current boolean. The idea is that there are many home pages that the admin is working on at any given time, but only one is current at a time. At the moment, I have enforced this with the following:
I think you may have this the wrong way round, instead of remembering
which one is current in the page put it in the admin model, then you
only need to change it there and not touch the pages at all.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home