Module: AMEE::Rails::InstanceMethods

Defined in:
lib/amee/rails.rb

Instance Method Summary collapse

Instance Method Details

#amee_connectionObject



91
92
93
94
# File 'lib/amee/rails.rb', line 91

def amee_connection
  # Should be overridden by code which doesn't use the global AMEE connection
  AMEE::Rails.connection
end

#amee_createObject



73
74
75
76
77
# File 'lib/amee/rails.rb', line 73

def amee_create
  # Create profile
  profile = AMEE::Profile::Profile.create(amee_connection)
  self.amee_profile = profile.uid
end

#amee_destroyObject



84
85
86
87
88
89
# File 'lib/amee/rails.rb', line 84

def amee_destroy
  # Delete profile
  AMEE::Profile::Profile.delete(amee_connection, amee_profile)
rescue
  puts "Couldn't remove profile #{amee_profile}"
end

#amee_saveObject



79
80
81
82
# File 'lib/amee/rails.rb', line 79

def amee_save
  # This is only here to be overridden
  return true
end