how to skip before_save filter in Rails for specific command

Posted by Tam on Stack Overflow See other posts from Stack Overflow or by Tam
Published on 2010-04-01T02:48:21Z Indexed on 2010/04/01 2:53 UTC
Read the original article Hit count: 406

Filed under:

I have a before_save defined as follows:

  def before_save
    self.token = generate_token
  end

I want to skip it for specific save method calls. so in my code I would like to do

@user.save

without before_save filter getting called. Can I do that?

© Stack Overflow or respective owner

Related posts about ruby-on-rails