Module: AMEE::Rails::ClassMethods

Defined in:
lib/amee/rails.rb

Instance Method Summary collapse

Instance Method Details

#has_amee_profile(options = {}) ⇒ Object



59
60
61
62
63
64
65
66
67
68
# File 'lib/amee/rails.rb', line 59

def has_amee_profile(options = {})
  # Include the instance methods for creation and desctruction
  include InstanceMethods
  # Install callbacks
  before_validation :amee_create, :on => :create
  after_save :amee_save
  before_destroy :amee_destroy
  # Check that this object has an AMEE profile UID when saving
  validates_presence_of :amee_profile
end