Skip to content

Instantly share code, notes, and snippets.

@alessioalex
Created August 3, 2011 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alessioalex/1123514 to your computer and use it in GitHub Desktop.
Save alessioalex/1123514 to your computer and use it in GitHub Desktop.
class Person < ActiveRecord::Base
before_save :cleanup
def name
"#{first_name} #{last_name}"
end
private
def cleanup
self[:first_name] = self[:first_name].capitalize
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment