Module: AMEE::Rails::InstanceMethods

Defined in:
lib/amee/rails.rb

Instance Method Summary collapse

Instance Method Details

#amee_connectionObject



83
84
85
86
# File 'lib/amee/rails.rb', line 83

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

#amee_createObject



65
66
67
68
69
# File 'lib/amee/rails.rb', line 65

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

#amee_destroyObject



76
77
78
79
80
81
# File 'lib/amee/rails.rb', line 76

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

#amee_saveObject



71
72
73
74
# File 'lib/amee/rails.rb', line 71

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