lib/amee/profile_api/profile_item.rb in hookercookerman-amee-0.0.9 vs lib/amee/profile_api/profile_item.rb in hookercookerman-amee-0.1.0

- old
+ new

@@ -17,11 +17,15 @@ def self.create(session, path, data_item_uid, fields ={}) hash = session.create_profile_data_category(path, data_item_uid, :fields => fields) self.from_hash(hash, session) end - def update(fields) - session.update_profile_item(self.full_path, :fields => fields) + def update(fields = {}) + session.api_call(:put, "profile_item", self.full_path, + :query => fields.merge({:representation => true})) do |response| + populate_from_hash!(response) + end + self end def destroy session.delete_profile_item(self.full_path) end \ No newline at end of file