mls 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02850148a3e96cfb9ed81d4acf27060f3f38d3b3
4
- data.tar.gz: 63f702c4c5c63b7eb05fa6c7e50554cb1ed30e7d
3
+ metadata.gz: 9395ac184fa05f0d46426ba0d0fc7acc27947acd
4
+ data.tar.gz: 1b48bb06bc9a2f3b9324dd1eab066f58fccad9ac
5
5
  SHA512:
6
- metadata.gz: e227236ccc27936b17ea7de888a28e7cbfc0298d6122d8c366042dad72f6b6fc56ab6f1cb5073e9737bda3e29760ed4c2e2d4ff96624f8b69651ec083c862db2
7
- data.tar.gz: 9c0275c121db1a4c3d4b12d85c0f939d800d76077fc5d42454920632f650a7238ea9f1d55c4d8dce0e5bb1e93a418fc003aaf88eb1067f8bfda4493c83034f46
6
+ metadata.gz: d2cbb2a472f4e7ba13c5aa1c42c593fc54b6180aff4fa733f74eff79a1ff479a1c2be101b2816231755357f5fd9259990283918b220449c71573b625e06e596f
7
+ data.tar.gz: 0716bd2e36189e18f1bdf5047a06ce7704600fe947910cfd345ac09c69bd73a42cd6767abf84307a9aa083871986b11e95c44edc9aa21f326176433302d0e0f6
data/lib/mls.rb CHANGED
@@ -67,7 +67,7 @@ module MLS::Avatar
67
67
 
68
68
  url_params = {s: options[:style], bg: options[:bg]}.select{ |k, v| v }
69
69
  result = "#{options[:protocol]}://#{MLS.image_host}/#{avatar_digest}.#{options[:format]}"
70
- result += "?#{url_params.to_param}" if url_params.size > 1
70
+ result += "?#{url_params.to_param}" if url_params.size > 0
71
71
 
72
72
  result
73
73
  end
@@ -76,7 +76,7 @@ end
76
76
 
77
77
  require 'mls/photo'
78
78
  require 'mls/account'
79
- require 'mls/brokerage'
79
+ require 'mls/organization'
80
80
  require 'mls/property'
81
81
  require 'mls/region'
82
82
  require 'mls/listing'
@@ -99,4 +99,4 @@ require 'mls/use'
99
99
  # def current_account
100
100
  # end
101
101
  #
102
- # end
102
+ # end
data/lib/mls/account.rb CHANGED
@@ -2,7 +2,7 @@ class Account < MLS::Model
2
2
 
3
3
  include MLS::Avatar
4
4
 
5
- belongs_to :brokerage
5
+ belongs_to :organization
6
6
 
7
7
  has_many :agencies, :inverse_of => :agent, :foreign_key => :agent_id
8
8
 
data/lib/mls/listing.rb CHANGED
@@ -101,6 +101,8 @@ class Listing < MLS::Model
101
101
  else
102
102
  raise "Invalid rate conversion (#{rate_units} => #{units})"
103
103
  end
104
+ else
105
+ read_attribute(:rate)
104
106
 
105
107
  end
106
108
 
@@ -0,0 +1,8 @@
1
+ class Organization < MLS::Model
2
+ include MLS::Avatar
3
+
4
+ def name
5
+ common_name || legal_name
6
+ end
7
+
8
+ end
data/lib/mls/property.rb CHANGED
@@ -4,7 +4,7 @@ class Property < MLS::Model
4
4
  include MLS::Avatar
5
5
 
6
6
  belongs_to :contact, :class_name => 'Account'
7
-
7
+
8
8
  has_many :listings
9
9
  has_many :localities
10
10
  has_many :regions, :through => :localities
@@ -13,12 +13,12 @@ class Property < MLS::Model
13
13
 
14
14
  has_many :addresses
15
15
  has_one :address, -> { where(:primary => true) }
16
-
16
+
17
17
  def default_contact
18
18
  @default_contact ||= listings.where(lease_state: :listed, state: :visible)
19
19
  .where({ type: ['Lease', 'Sublease', 'Sale']})
20
20
  .order(size: :desc)
21
21
  .first.try(:contact)
22
22
  end
23
-
24
- end
23
+
24
+ end
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.0.0'
6
+ s.version = '1.1.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.0.0
4
+ version: 1.1.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-09-08 00:00:00.000000000 Z
12
+ date: 2014-09-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -195,13 +195,13 @@ files:
195
195
  - lib/mls/account.rb
196
196
  - lib/mls/address.rb
197
197
  - lib/mls/agency.rb
198
- - lib/mls/brokerage.rb
199
198
  - lib/mls/coworking_space.rb
200
199
  - lib/mls/floorplan.rb
201
200
  - lib/mls/flyer.rb
202
201
  - lib/mls/lease.rb
203
202
  - lib/mls/listing.rb
204
203
  - lib/mls/locality.rb
204
+ - lib/mls/organization.rb
205
205
  - lib/mls/photo.rb
206
206
  - lib/mls/property.rb
207
207
  - lib/mls/region.rb
data/lib/mls/brokerage.rb DELETED
@@ -1,7 +0,0 @@
1
- class Brokerage < MLS::Model
2
-
3
- def name
4
- common_name || proper_name
5
- end
6
-
7
- end