Hi, does anyone have some suggestion as to how I would NOT persist a model
if some condition/attribute check of the model instance is true?
The condition would be some method I run using before_save or similar, and i
would like a method within the model to set some parameter of the model
which would render it not saveable (no error or notice should be triggered)
-- if it was a new instance, and would delete an existing instance of it
from the DB.
Using ActiveRecord.

Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/VJxFVLy751kJ.
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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Colin Law at Oct 6, 2011 at 8:53 am

    On 4 October 2011 06:45, Victor Stan wrote:
    Hi, does anyone have some suggestion as to how I would NOT persist a model
    Why is everybody asking questions twice today?

    See previous reply by me, though I am not sure it answers all the
    points below. Please continue the discussion on the other thread if
    necessary.

    Colin
    if some condition/attribute check of the model instance is true?
    The condition would be some method I run using before_save or similar, and i
    would like a method within the model to set some parameter of the model
    which would render it not saveable (no error or notice should be triggered)
    -- if it was a new instance, and would delete an existing instance of it
    from the DB.
    Using ActiveRecord.
    Thanks

    --
    You received this message because you are subscribed to the Google Groups
    "Ruby on Rails: Talk" group.
    To view this discussion on the web visit
    https://groups.google.com/d/msg/rubyonrails-talk/-/VJxFVLy751kJ.
    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 this group at
    http://groups.google.com/group/rubyonrails-talk?hl=en.


    --
    gplus.to/clanlaw

    --
    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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 5, '11 at 9:25p
activeOct 6, '11 at 8:53a
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Victor Stan: 1 post Colin Law: 1 post

People

Translate

site design / logo © 2022 Grokbase