lib/amee/profile_item.rb in Floppy-amee-2.0.5 vs lib/amee/profile_item.rb in Floppy-amee-2.0.6

- old
+ new

@@ -281,9 +281,21 @@ end rescue raise AMEE::BadData.new("Couldn't create ProfileItem. Check that your information is correct.") end + def self.create_batch_without_category(connection, category_path, items) + if connection.format == :json + post_data = ({:profileItems => items}).to_json + else + post_data = ({:ProfileItems => items}).to_xml(:root => "ProfileCategory", :skip_types => true, :skip_nil => true) + end + # Post to category + response = connection.raw_post(category_path, post_data) + # Send back a category object containing all the created items + AMEE::Profile::Category.parse(connection, response) + end + def self.update(connection, path, options = {}) response = connection.put(path, options) return Item.parse(connection, response) rescue raise AMEE::BadData.new("Couldn't update ProfileItem. Check that your information is correct.")