Skip to content

Instantly share code, notes, and snippets.

@memaker
Created December 7, 2016 18:02
Show Gist options
  • Save memaker/53d4c87dd2cbdbfa0127e67cab5378d8 to your computer and use it in GitHub Desktop.
Save memaker/53d4c87dd2cbdbfa0127e67cab5378d8 to your computer and use it in GitHub Desktop.
# app/models/person.rb
Person < ApplicationRecord
validates :name, presence: true
validates :age, presence: true
def identifier
[name, age].join " "
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment