mls 0.2.21 → 0.2.23
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mls/models/listing.rb +1 -1
- data/lib/mls/models/photo.rb +4 -4
- data/mls.gemspec +2 -2
- metadata +4 -3
data/lib/mls/models/listing.rb
CHANGED
@@ -165,7 +165,7 @@ class MLS::Listing < MLS::Resource
|
|
165
165
|
def to_hash
|
166
166
|
hash = super
|
167
167
|
hash[:address_attributes] = address.to_hash if address
|
168
|
-
hash[:agents_attributes] = agents.inject(
|
168
|
+
hash[:agents_attributes] = agents.inject([]) { |acc, x| acc << x.to_hash; acc } if agents
|
169
169
|
hash[:photo_ids] = photos.map(&:id) if photos
|
170
170
|
hash[:videos_attributes] = videos.map(&:to_hash) if videos
|
171
171
|
hash
|
data/lib/mls/models/photo.rb
CHANGED
@@ -15,13 +15,13 @@ class MLS::Photo < MLS::Resource
|
|
15
15
|
"#{protocol}://#{MLS.asset_host}/photos/#{style}/#{@digest}.jpg"
|
16
16
|
end
|
17
17
|
|
18
|
-
def self.create(
|
19
|
-
|
18
|
+
def self.create(attrs)
|
19
|
+
attrs[:file].rewind
|
20
20
|
url = MLS.url.dup
|
21
21
|
url.user = nil
|
22
22
|
url.path = "/api/photos"
|
23
|
-
response = RestClient.post(url.to_s, {:file =>
|
24
|
-
|
23
|
+
response = RestClient.post(url.to_s, {:file => attrs[:file]}, MLS.headers)
|
24
|
+
attrs[:file].close unless attrs[:file].closed?
|
25
25
|
|
26
26
|
MLS::Photo::Parser.parse(response.body)
|
27
27
|
end
|
data/mls.gemspec
CHANGED
@@ -3,8 +3,8 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "mls"
|
6
|
-
s.version = '0.2.
|
7
|
-
s.authors = ["James R. Bracy"]
|
6
|
+
s.version = '0.2.23'
|
7
|
+
s.authors = ["James R. Bracy", "Jon Bracy"]
|
8
8
|
s.email = ["james@42floors.com"]
|
9
9
|
s.homepage = "http://mls.42floors.com"
|
10
10
|
s.summary = %q{42Floors MLS Client}
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.23
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James R. Bracy
|
9
|
+
- Jon Bracy
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
13
|
+
date: 2013-01-21 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: rake
|
@@ -281,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
282
|
version: '0'
|
282
283
|
requirements: []
|
283
284
|
rubyforge_project: mls
|
284
|
-
rubygems_version: 1.8.
|
285
|
+
rubygems_version: 1.8.23
|
285
286
|
signing_key:
|
286
287
|
specification_version: 3
|
287
288
|
summary: 42Floors MLS Client
|