Skip to content

Instantly share code, notes, and snippets.

@cdesch
Created May 12, 2016 23:59
Show Gist options
  • Save cdesch/6fbef23aa31084947f45f2c2c26ec2b9 to your computer and use it in GitHub Desktop.
Save cdesch/6fbef23aa31084947f45f2c2c26ec2b9 to your computer and use it in GitHub Desktop.
after_initialize :set_default_values, :if => :new_record?
validates_presence_of :title, :hidden
def set_default_values
self.hidden ||= false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment