lib/mls/models/photo.rb in mls-0.2.21 vs lib/mls/models/photo.rb in mls-0.2.23
- old
+ new
@@ -13,16 +13,16 @@
def url(style='large', protocol='http')
"#{protocol}://#{MLS.asset_host}/photos/#{style}/#{@digest}.jpg"
end
- def self.create(image_file)
- image_file.rewind
+ def self.create(attrs)
+ attrs[:file].rewind
url = MLS.url.dup
url.user = nil
url.path = "/api/photos"
- response = RestClient.post(url.to_s, {:file => image_file}, MLS.headers)
- image_file.close unless image_file.closed?
+ response = RestClient.post(url.to_s, {:file => attrs[:file]}, MLS.headers)
+ attrs[:file].close unless attrs[:file].closed?
MLS::Photo::Parser.parse(response.body)
end
end