mls 1.1.1 → 1.1.2

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: 9dce8f560d0309ad984548496c76d04c9460917e
4
- data.tar.gz: 945c36072ee934a08926697c815a104975b37092
3
+ metadata.gz: 04c7eecf5f527a902375f9a296b61c8e0a538b4e
4
+ data.tar.gz: 5ef89b440f2e2765ddc10ba63f3c413c72a7fe42
5
5
  SHA512:
6
- metadata.gz: 1941965dbdaae210a831f958f48dacd667479fec5ddc8d54eb096e5bf7e0520f9754a729d97d2b1daffe195eb43b12e2e7e70416e574c566354a866c43997f74
7
- data.tar.gz: 6cf8c1754a7f8255543463e647944996e8dec2e1df95fa18dd4a1fee3d9147351567f9c629e656c9d2075a7b3b3b7a5fc1b28112e2fca193a56e2a0c9171e0ba
6
+ metadata.gz: a60c8cdf94a51713178a87a18dd7361afd2b19f888fc0122376dd79c4b0449fb6741eec9e9b33c2879b29f1cc479b11faed6ff13f1121d6395051b3e0898903d
7
+ data.tar.gz: 77cc16a7c5d705a13770b4e460e8800a95fb95a865fdd684b94152bebba7a1a737128004822b610a3d285dbf90103e8f43b5af4e4b796a0192eedc55b5d4f5e8
data/lib/mls.rb CHANGED
@@ -12,11 +12,23 @@ module MLS
12
12
  end
13
13
 
14
14
  def self.asset_host
15
- MLS::Model.connection.server_config['asset_host']
15
+ config['asset_host']
16
16
  end
17
17
 
18
18
  def self.image_host
19
- MLS::Model.connection.server_config['image_host']
19
+ config['image_host']
20
+ end
21
+
22
+ def self.config
23
+ @config ||= MLS::Model.connection.server_config
24
+ end
25
+
26
+ # Set a cookie jar to use during request sent during the
27
+ def self.with_cookie_store(store, &block)
28
+ Thread.current[:sunstone_cookie_store] = store
29
+ yield
30
+ ensure
31
+ Thread.current[:sunstone_cookie_store] = nil
20
32
  end
21
33
 
22
34
  end
@@ -83,6 +95,7 @@ require 'mls/listing'
83
95
  require 'mls/lease'
84
96
  require 'mls/sublease'
85
97
  require 'mls/space'
98
+ require 'mls/lead'
86
99
  require 'mls/sale'
87
100
  require 'mls/coworking_space'
88
101
  require 'mls/address'
@@ -90,6 +103,7 @@ require 'mls/locality'
90
103
  require 'mls/flyer'
91
104
  require 'mls/inquiry'
92
105
  require 'mls/agency'
106
+ require 'mls/session'
93
107
  require 'mls/floorplan'
94
108
  require 'mls/use'
95
109
 
data/lib/mls/account.rb CHANGED
@@ -1,15 +1,11 @@
1
1
  class Account < MLS::Model
2
2
 
3
3
  include MLS::Avatar
4
-
4
+
5
+ has_one :lead, foreign_key: :account_id
6
+
5
7
  belongs_to :organization
6
8
 
7
9
  has_many :agencies, :inverse_of => :agent, :foreign_key => :agent_id
8
-
9
- # def self.authenticate(email, pass)
10
- # account = where(arel_table[:email].eq(email.try(:downcase)).and(arel_table[:password_digest].not_eq(nil))).first
11
- # account && BCrypt::Password.new(account.password_digest) == pass ? account : nil
12
- # end
13
-
14
10
 
15
11
  end
data/lib/mls/lead.rb ADDED
@@ -0,0 +1,5 @@
1
+ class Lead < MLS::Model
2
+
3
+ belongs_to :account
4
+
5
+ end
@@ -0,0 +1,13 @@
1
+ class Session < MLS::Model
2
+
3
+ belongs_to :account
4
+
5
+ def self.authenticate(email, password)
6
+ Session.create(:email => email, :password => password)
7
+ end
8
+
9
+ def self.authenticate_by_token(token)
10
+ Session.create(:token => token)
11
+ end
12
+
13
+ end
data/lib/mls/use.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  class Use < MLS::Model
2
2
 
3
+ include MLS::Slugger
3
4
  # has_ltree_hierarchy
4
5
 
5
6
  has_many :children, class_name: 'Use', foreign_key: 'parent_id', inverse_of: :parent
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.1.1'
6
+ s.version = '1.1.2'
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.1
4
+ version: 1.1.2
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-11 00:00:00.000000000 Z
12
+ date: 2014-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -199,6 +199,7 @@ files:
199
199
  - lib/mls/floorplan.rb
200
200
  - lib/mls/flyer.rb
201
201
  - lib/mls/inquiry.rb
202
+ - lib/mls/lead.rb
202
203
  - lib/mls/lease.rb
203
204
  - lib/mls/listing.rb
204
205
  - lib/mls/locality.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/mls/property.rb
208
209
  - lib/mls/region.rb
209
210
  - lib/mls/sale.rb
211
+ - lib/mls/session.rb
210
212
  - lib/mls/space.rb
211
213
  - lib/mls/sublease.rb
212
214
  - lib/mls/use.rb