Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding floorplan_id to the Listing model.

  • Loading branch information...
commit c1890ffbba3f45a93959ca820c835a1023abd811 1 parent 86ee7cb
@waratuman waratuman authored
View
8 lib/mls/models/account.rb
@@ -1,11 +1,7 @@
class MLS::Account < MLS::Resource
- ROLES = %w(user broker property_manager landlord analyst assistant other)
- DEFAULTS = {:role => 'user'}
-
property :id, Fixnum
- property :type, String, :default => 'User'
- property :role, String, :default => 'user'
+ property :type, String, :default => 'Account'
property :name, String
property :title, String
property :email, String
@@ -63,7 +59,7 @@ def create
end
def agent?
- role != 'user' && role != ''
+ type == 'Agent'
end
def favorites
View
7 lib/mls/models/listing.rb
@@ -18,7 +18,7 @@ class MLS::Listing < MLS::Resource
property :source_url, String
property :source_type, String, :serialize => :if_present
property :channel, String, :serialize => :if_present
-
+
property :name, String
property :type, String, :default => 'lease'
property :state, String, :default => 'listed'
@@ -26,11 +26,11 @@ class MLS::Listing < MLS::Resource
property :unit, String
property :floor, Fixnum
property :comments, String
-
+
property :total_size, Fixnum
property :maximum_contiguous_size, Fixnum
property :minimum_divisable_size, Fixnum
-
+
property :lease_terms, String
property :rate, Decimal
property :rate_units, String, :default => '/sqft/mo'
@@ -62,6 +62,7 @@ class MLS::Listing < MLS::Resource
property :leased_on, DateTime
property :flyer_id, Fixnum, :serialize => :if_present
+ property :floorplan_id Fixnum, :serialize => :if_present
property :avatar_digest, String, :serialize => false
attr_accessor :address, :agents, :account, :photos, :flyer, :floorplan, :videos
View
2  mls.gemspec
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = "mls"
- s.version = '0.2.24'
+ s.version = '0.2.25'
s.authors = ["James R. Bracy", "Jon Bracy"]
s.email = ["james@42floors.com"]
s.homepage = "http://mls.42floors.com"
View
2  test/factories/account.rb
@@ -7,7 +7,7 @@
end
factory :broker, :class => MLS::Account, :parent => :account do
- role 'broker'
+ type 'Account'
end
factory :ghost_account, :class => MLS::Account do
Please sign in to comment.
Something went wrong with that request. Please try again.