mls 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mls.rb +13 -4
- data/lib/mls/account.rb +1 -0
- data/lib/mls/listing.rb +3 -2
- data/lib/mls/organization.rb +4 -1
- data/lib/mls/photo.rb +16 -4
- data/lib/mls/property.rb +7 -4
- data/mls.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb4f1f49e4d47a1947018382340a4189a949fe96
|
4
|
+
data.tar.gz: 413f3241e6392a275e93ffbcbdc2e8ee9f5da48c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7039ef61eedc1426662d6bbf3d52e7c308537f404a111c6e2f83fc1a8d36da2d328729e43c3678eb73a79a87070b2a3dcbf97d2b630d042733c1b76dac51be75
|
7
|
+
data.tar.gz: 3ec113f6972d240cfe47f04f1b4998ad5eeaa370d3ad1e8cd93e15ceb025bb25b6e971dd006a27edbeff7879dc74a2eacabbe67eaa1d03f86cb76537f932fb83
|
data/lib/mls.rb
CHANGED
@@ -70,15 +70,24 @@ module MLS::Avatar
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def avatar_url(options={})
|
73
|
+
|
73
74
|
options.reverse_merge!({
|
74
75
|
:style => nil,
|
75
|
-
:protocol => "http",
|
76
76
|
:bg => nil,
|
77
|
-
:
|
77
|
+
:protocol => 'https',
|
78
|
+
:format => "jpg",
|
79
|
+
:host => MLS.image_host
|
78
80
|
});
|
79
81
|
|
80
|
-
url_params = {s: options[:style], bg: options[:bg]}.select{ |k, v| v }
|
81
|
-
|
82
|
+
url_params = { s: options[:style], bg: options[:bg] }.select{ |k, v| v }
|
83
|
+
|
84
|
+
if options[:protocol] == :relative # Protocol Relative
|
85
|
+
result = '//'
|
86
|
+
else options[:protocol]
|
87
|
+
result = "#{options[:protocol]}://"
|
88
|
+
end
|
89
|
+
|
90
|
+
result += "#{options[:host]}/#{avatar_digest}.#{options[:format]}"
|
82
91
|
result += "?#{url_params.to_param}" if url_params.size > 0
|
83
92
|
|
84
93
|
result
|
data/lib/mls/account.rb
CHANGED
data/lib/mls/listing.rb
CHANGED
@@ -16,7 +16,8 @@ class Listing < MLS::Model
|
|
16
16
|
'/yr' => 'rate_per_year',
|
17
17
|
}
|
18
18
|
TERM_UNITS = ['years', 'months']
|
19
|
-
AMENITIES = %W(kitchen showers
|
19
|
+
AMENITIES = %W(kitchen showers outdoor_space reception turnkey build_to_suit furniture
|
20
|
+
natural_light high_ceilings plug_and_play additional_storage storefront)
|
20
21
|
|
21
22
|
belongs_to :property
|
22
23
|
belongs_to :floorplan
|
@@ -24,7 +25,7 @@ class Listing < MLS::Model
|
|
24
25
|
|
25
26
|
has_many :spaces
|
26
27
|
|
27
|
-
has_many :photos, -> { order(
|
28
|
+
has_many :photos, -> { order(:order => :asc) }, :as => :subject, :inverse_of => :subject
|
28
29
|
|
29
30
|
has_many :agencies, -> { order(:order) }, :as => :subject
|
30
31
|
has_many :agents, -> { order('agencies.order') }, :through => :agencies, :source => :agent
|
data/lib/mls/organization.rb
CHANGED
data/lib/mls/photo.rb
CHANGED
@@ -5,14 +5,26 @@ class Photo < MLS::Model
|
|
5
5
|
def url(options={})
|
6
6
|
options.reverse_merge!({
|
7
7
|
:style => nil,
|
8
|
-
:protocol => "http",
|
9
8
|
:bg => nil,
|
10
|
-
:
|
9
|
+
:protocol => 'https',
|
10
|
+
:format => "jpg",
|
11
|
+
:host => MLS.image_host
|
11
12
|
});
|
13
|
+
|
12
14
|
url_params = {s: options[:style], bg: options[:bg]}.select{ |k, v| v }
|
13
|
-
|
15
|
+
|
16
|
+
if options[:protocol] == :relative # Protocol Relative
|
17
|
+
result = '//'
|
18
|
+
else options[:protocol]
|
19
|
+
result = "#{options[:protocol]}://"
|
20
|
+
end
|
21
|
+
|
22
|
+
result += "#{options[:host]}/#{digest}.#{options[:format]}"
|
14
23
|
result += "?#{url_params.to_param}" if url_params.size > 0
|
15
24
|
|
16
25
|
result
|
17
26
|
end
|
18
|
-
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
class InternalPhoto < Photo; end
|
data/lib/mls/property.rb
CHANGED
@@ -8,11 +8,14 @@ class Property < MLS::Model
|
|
8
8
|
has_many :listings
|
9
9
|
has_many :localities
|
10
10
|
has_many :regions, :through => :localities
|
11
|
-
has_many :photos, -> {
|
12
|
-
|
11
|
+
has_many :photos, -> { where(:type => "Photo").order(:order => :asc) }, :as => :subject, :inverse_of => :subject
|
12
|
+
has_many :internal_photos, -> { order(:order => :asc) }, :as => :subject, :inverse_of => :subject
|
13
13
|
|
14
|
-
has_many :addresses
|
15
|
-
|
14
|
+
has_many :addresses do
|
15
|
+
def primary
|
16
|
+
where(:primary => true).first
|
17
|
+
end
|
18
|
+
end
|
16
19
|
|
17
20
|
def default_contact
|
18
21
|
@default_contact ||= listings.where(lease_state: :listed, ghost: false, authorized: true)
|
data/mls.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "mls"
|
6
|
-
s.version = '1.
|
6
|
+
s.version = '1.4.0'
|
7
7
|
s.authors = ["Jon Bracy", "James R. Bracy"]
|
8
8
|
s.email = ["jon@42floors.com", "james@42floors.com"]
|
9
9
|
s.homepage = "http://mls.42floors.com"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|