On Mar 5, 6:11 am, CFC <[email protected]> wrote:
> If I set read-only to the model, then I can't create any event
> anymore :(
> I just want to block anyone to update/destroy records, but I need to
> create records :)
>
Check whether new_record? is true before returning false from your
callback ?
Fred
> On 3月5日, 下午1時12分, Robert Walker <[email protected]>
> wrote:
>
> > Billy Hsu wrote:
> > > I have a model named: Event
> > > And I don't want anyone to destroy or update any records in Event
> > > model.
> > > So:
>
> > How about instead making the model read-only:
>
> >http://ariejan.net/2008/08/17/activerecord-read-only-models/
> > --
> > Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---