lib/caren/product.rb in caren-api-0.4.17 vs lib/caren/product.rb in caren-api-0.4.18
- old
+ new
@@ -31,18 +31,18 @@
def self.all session
from_xml session.get(self.resource_url)
end
def create session
- from_xml session.post(self.resource_url, self.to_xml)
+ self.class.from_xml session.post(self.resource_url, self.to_xml)
end
def update session
- from_xml session.put(self.resource_url(self.id), self.to_xml)
+ self.class.from_xml session.put(self.resource_url(self.id), self.to_xml)
end
def update_photo photo_hash_or_path, session
- session.put(self.resource_url(self.id), self.to_photo_xml(photo_hash_or_path))
+ self.class.from_xml session.put(self.resource_url(self.id), self.to_photo_xml(photo_hash_or_path))
end
def as_xml
{ :name => self.name,
:description => self.description,
\ No newline at end of file