mls 1.1.4 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbe4c5d0e51a15c6a0ffed14435fee0f31ab448f
4
- data.tar.gz: 7c9ba424dedbf1cf02a331f20af33faa54bfa58d
3
+ metadata.gz: 1d966f4641bdffc44263761b3feb02e298e21dca
4
+ data.tar.gz: fcccc0fa5e8595beaa734bd44af6c4d04d0d7bca
5
5
  SHA512:
6
- metadata.gz: 0085977e32094f3866b8e945b2e71e71e981bb204c710caa360d9502628a42e3c5edcce3a5ba1dac7785c565e293009012e92a1311de9e4cc36ebb5db0352478
7
- data.tar.gz: 364147eef25f9cad12e97ff83dcc8d888a92996e74ac98da6e3e2b76722aeca9731b586b19de6d7a0a5bd7814ec5997bee0ce5b7ab6272455f3d06d620d4725a
6
+ metadata.gz: cad4104cad88b181f74d4598bd693f1c9591ef1d39bd170468297b3e08f3c578d7c3edec24e15c5eb1087c3681a51e2dc7a665c3438d4bea1fb68f4260fb8856
7
+ data.tar.gz: d0c8e5a94404263d58fa5adff8530b3bc21a00c140e1d3ac1cd4d9b4171ed0e8cc203131ddd4d58e331c341f077ce493a87c81652ec495d327264d4be809dd31
data/lib/mls.rb CHANGED
@@ -92,14 +92,10 @@ require 'mls/organization'
92
92
  require 'mls/property'
93
93
  require 'mls/region'
94
94
  require 'mls/listing'
95
- require 'mls/lease'
96
- require 'mls/sublease'
97
95
  require 'mls/space'
98
96
  require 'mls/lead'
99
97
  require 'mls/lead_listing'
100
98
  require 'mls/lead_property'
101
- require 'mls/sale'
102
- require 'mls/coworking_space'
103
99
  require 'mls/address'
104
100
  require 'mls/locality'
105
101
  require 'mls/flyer'
@@ -1,7 +1,8 @@
1
1
  class LeadListing < MLS::Model
2
-
2
+
3
3
  belongs_to :listing
4
4
  belongs_to :lead_property
5
5
  belongs_to :lead
6
-
7
- end
6
+ belongs_to :property
7
+
8
+ end
@@ -1,31 +1,37 @@
1
1
  class Listing < MLS::Model
2
-
2
+ self.inheritance_column = nil
3
+
3
4
  include MLS::Slugger
4
5
  include MLS::Avatar
5
6
 
6
- WORKFLOW_STATES = %w(visible processing invisible expired)
7
+ STATES = %w(processing visible invisible off_market expired)
7
8
  LEASE_STATES = %w(listed leased)
8
- TYPES = %w(lease sublease coworking_space)
9
9
  SPACE_TYPES = %w(unit floor building)
10
- LEASE_TERMS = ['Full Service', 'NNN', 'Modified Gross']
11
- RATE_UNITS = ['/sqft/yr', '/sqft/mo', '/mo', '/yr', '/desk/mo']
12
- USES = ["Office", "Creative", "Loft", "Medical Office", "Flex Space", "R&D", "Office Showroom", "Industrial", "Retail"]
13
- SOURCE_TYPES = %w(website flyer)
14
- CHANNELS = %w(excavator mls staircase broker_dashboard)
10
+ TYPES = %w(Sale Lease Sublease CoworkingSpace)
11
+ TERMS = ['Full Service', 'Net Lease', 'NN', 'NNN', 'Absolute NNN', 'Gross Lease', 'Modified Gross', 'Industrial Gross', 'Absolute Gross', 'Ground Lease', 'Other']
12
+ SALE_TERMS = ['Cash to Seller', 'Purchase Money Mtg.', 'Owner Financing', 'Build-to-Suit', 'Sale/Leaseback', 'Other']
13
+ RATE_UNITS = {
14
+ '/sqft/yr' => 'rate_per_sqft_per_year',
15
+ '/sqft/mo' => 'rate_per_sqft_per_month',
16
+ '/mo' => 'rate_per_month',
17
+ '/yr' => 'rate_per_year',
18
+ }
19
+ TERM_UNITS = ['years', 'months']
20
+ AMENITIES = %W(kitchen showers patio reception ready_to_move_in furniture natural_light high_ceilings)
15
21
 
16
22
  belongs_to :property
17
23
  belongs_to :floorplan
18
24
  belongs_to :flyer
19
-
25
+
26
+ has_many :spaces
27
+
20
28
  has_many :photos, -> { order('photos.order ASC') }, :as => :subject, :inverse_of => :subject
21
29
 
22
30
  has_many :agencies, -> { order(:order) }, :as => :subject
23
31
  has_many :agents, :through => :agencies, :source => :agent
24
-
25
- # has_one :address
26
- # has_one :contact
27
- #
28
- # has_many :addresses
32
+
33
+ has_one :address
34
+ has_many :addresses
29
35
 
30
36
  # has_many :comments
31
37
  # has_many :regions
@@ -108,7 +114,23 @@ class Listing < MLS::Model
108
114
 
109
115
  price.round(2)
110
116
  end
111
-
117
+
118
+ def lease? # TODO: test me
119
+ type == 'Lease'
120
+ end
121
+
122
+ def sublease? # TODO: test me
123
+ type == 'Sublease'
124
+ end
125
+
126
+ def coworking? # TODO: test me
127
+ type == 'CoworkingSpace'
128
+ end
129
+
130
+ def sale?
131
+ type == 'Sale'
132
+ end
133
+
112
134
  def name
113
135
  return read_attribute(:name) if read_attribute(:name)
114
136
 
@@ -2,7 +2,7 @@ class Region < MLS::Model
2
2
 
3
3
  include MLS::Slugger
4
4
 
5
- self.inheritance_column = 'inheritance_type'
5
+ self.inheritance_column = nil
6
6
 
7
7
  belongs_to :cover_photo, :class_name => 'Photo'
8
8
 
@@ -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.1.4'
6
+ s.version = '1.2.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.1.4
4
+ version: 1.2.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-10-01 00:00:00.000000000 Z
12
+ date: 2014-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -195,24 +195,20 @@ files:
195
195
  - lib/mls/account.rb
196
196
  - lib/mls/address.rb
197
197
  - lib/mls/agency.rb
198
- - lib/mls/coworking_space.rb
199
198
  - lib/mls/floorplan.rb
200
199
  - lib/mls/flyer.rb
201
200
  - lib/mls/inquiry.rb
202
201
  - lib/mls/lead.rb
203
202
  - lib/mls/lead_listing.rb
204
203
  - lib/mls/lead_property.rb
205
- - lib/mls/lease.rb
206
204
  - lib/mls/listing.rb
207
205
  - lib/mls/locality.rb
208
206
  - lib/mls/organization.rb
209
207
  - lib/mls/photo.rb
210
208
  - lib/mls/property.rb
211
209
  - lib/mls/region.rb
212
- - lib/mls/sale.rb
213
210
  - lib/mls/session.rb
214
211
  - lib/mls/space.rb
215
- - lib/mls/sublease.rb
216
212
  - lib/mls/use.rb
217
213
  - mls.gemspec
218
214
  - test/fixtures/flyer.pdf
@@ -249,4 +245,3 @@ test_files:
249
245
  - test/mls/resource_test.rb
250
246
  - test/mls_test.rb
251
247
  - test/test_helper.rb
252
- has_rdoc:
@@ -1,5 +0,0 @@
1
- class CoworkingSpace < Listing
2
-
3
- has_many :spaces
4
-
5
- end
@@ -1,2 +0,0 @@
1
- class Lease < Listing
2
- end
@@ -1,2 +0,0 @@
1
- class Sale < Listing
2
- end
@@ -1,2 +0,0 @@
1
- class Sublease < Listing
2
- end