Skip to content

Instantly share code, notes, and snippets.

@matthuhiggins
Created June 2, 2010 21:45
Show Gist options
  • Save matthuhiggins/423046 to your computer and use it in GitHub Desktop.
Save matthuhiggins/423046 to your computer and use it in GitHub Desktop.
class Post < ActiveRecord::Base
def title=(value)
self[:title] = value.present? ? value : 'Untitled'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment