Module: AMEE::Rails::InstanceMethods
- Defined in:
- lib/amee/rails.rb
Instance Method Summary collapse
- #amee_connection ⇒ Object
- #amee_create ⇒ Object
- #amee_destroy ⇒ Object
- #amee_save ⇒ Object
- #save_with_amee ⇒ Object
Instance Method Details
#amee_connection ⇒ Object
67 68 69 70 |
# File 'lib/amee/rails.rb', line 67 def amee_connection # Should be overridden by code which doesn't use the global AMEE connection AMEE::Rails.connection end |
#amee_create ⇒ Object
49 50 51 52 53 |
# File 'lib/amee/rails.rb', line 49 def amee_create # Create profile profile = AMEE::Profile::Profile.create(amee_connection) self.amee_profile = profile.uid end |
#amee_destroy ⇒ Object
60 61 62 63 64 65 |
# File 'lib/amee/rails.rb', line 60 def amee_destroy # Delete profile AMEE::Profile::Profile.delete(amee_connection, amee_profile) rescue puts "Couldn't remove profile #{amee_profile}" end |
#amee_save ⇒ Object
55 56 57 58 |
# File 'lib/amee/rails.rb', line 55 def amee_save # This is only here to be overridden return true end |
#save_with_amee ⇒ Object
45 46 47 |
# File 'lib/amee/rails.rb', line 45 def save_with_amee save_without_amee && amee_save end |