caboose-rets 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/caboose_rets/commercial_controller.rb +1 -1
- data/app/controllers/caboose_rets/land_controller.rb +2 -2
- data/app/controllers/caboose_rets/multi_family_controller.rb +1 -1
- data/app/controllers/caboose_rets/residential_controller.rb +3 -3
- data/app/controllers/caboose_rets/rets_controller.rb +1 -1
- data/app/models/caboose_rets/rets_importer.rb +40 -40
- data/lib/caboose_rets/version.rb +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: 3e19bdabb0eac8eee118964fc341c3dab4749dd8
|
4
|
+
data.tar.gz: 06a5f185d97de358a3a8e86ba7efe8a47f2ad126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a3bc9a49b3cb24dbba301bda5c8f7eeb6fcac35e8975c6f4dc9a38a9d187ae90cac77de3919b2f9be2cf260095236e28cfe697c142bd3c75102647df46ad0d7
|
7
|
+
data.tar.gz: bb8cfe88f3245b90cce96ccdf3ceb17b83aa7d69d1b28f5a2a44eafab94c5782a4aa8f0950a405aa1f27c4bdc72a9bf81067a3cbb1430d1cba8bd2c5a8f8da0a
|
@@ -336,7 +336,7 @@ module CabooseRets
|
|
336
336
|
return if !user_is_allowed('properties', 'edit')
|
337
337
|
|
338
338
|
p = CommercialProperty.find(params[:mls_acct])
|
339
|
-
p.delay.refresh_from_mls
|
339
|
+
p.delay(:queue => 'rets').refresh_from_mls
|
340
340
|
|
341
341
|
#RetsImporter.import("(MLS_ACCT=#{p.mls_acct})", 'Property', 'COM')
|
342
342
|
#RetsImporter.download_property_images(p)
|
@@ -87,7 +87,7 @@ module CabooseRets
|
|
87
87
|
@saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_acct => params[:mls_acct]).exists?
|
88
88
|
if @property.nil?
|
89
89
|
@mls_acct = params[:mls_acct]
|
90
|
-
CabooseRets::RetsImporter.delay.import_property(@mls_acct.to_i)
|
90
|
+
CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
91
91
|
render 'land/not_exists'
|
92
92
|
return
|
93
93
|
end
|
@@ -133,7 +133,7 @@ module CabooseRets
|
|
133
133
|
return if !user_is_allowed('properties', 'edit')
|
134
134
|
|
135
135
|
p = LandProperty.find(params[:mls_acct])
|
136
|
-
p.delay.refresh_from_mls
|
136
|
+
p.delay(:queue => 'rets').refresh_from_mls
|
137
137
|
|
138
138
|
resp = Caboose::StdClass.new
|
139
139
|
resp.success = "The property's info is being updated from MLS. This may take a few minutes depending on how many images it has."
|
@@ -61,7 +61,7 @@ module CabooseRets
|
|
61
61
|
@saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_acct => params[:mls_acct]).exists?
|
62
62
|
if @property.nil?
|
63
63
|
@mls_acct = params[:mls_acct]
|
64
|
-
CabooseRets::RetsImporter.delay.import_property(@mls_acct.to_i)
|
64
|
+
CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
65
65
|
render 'multi_family/not_exists'
|
66
66
|
return
|
67
67
|
end
|
@@ -98,7 +98,7 @@ module CabooseRets
|
|
98
98
|
end
|
99
99
|
if @property.nil?
|
100
100
|
@mls_acct = params[:mls_acct]
|
101
|
-
CabooseRets::RetsImporter.delay.import_property(@mls_acct.to_i)
|
101
|
+
CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
102
102
|
render 'residential/residential_not_exists'
|
103
103
|
return
|
104
104
|
end
|
@@ -113,7 +113,7 @@ module CabooseRets
|
|
113
113
|
|
114
114
|
#if @property.nil?
|
115
115
|
# @mls_acct = params[:mls_acct]
|
116
|
-
# CabooseRets::RetsImporter.delay.import_property(@mls_acct.to_i)
|
116
|
+
# CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(@mls_acct.to_i)
|
117
117
|
# render 'residential/residential_not_exists'
|
118
118
|
# return
|
119
119
|
#end
|
@@ -152,7 +152,7 @@ module CabooseRets
|
|
152
152
|
return if !user_is_allowed('properties', 'edit')
|
153
153
|
|
154
154
|
p = ResidentialProperty.find(params[:mls_acct])
|
155
|
-
p.delay.refresh_from_mls
|
155
|
+
p.delay(:queue => 'rets').refresh_from_mls
|
156
156
|
|
157
157
|
resp = Caboose::StdClass.new
|
158
158
|
resp.success = "The property's info is being updated from MLS. This may take a few minutes depending on how many images it has."
|
@@ -13,7 +13,7 @@ module CabooseRets
|
|
13
13
|
return if !user_is_allowed('properties', 'edit')
|
14
14
|
|
15
15
|
mls_acct = params[:mls_acct].to_i
|
16
|
-
CabooseRets::RetsImporter.delay.import_property(mls_acct)
|
16
|
+
CabooseRets::RetsImporter.delay(:queue => 'rets').import_property(mls_acct)
|
17
17
|
|
18
18
|
resp = Caboose::StdClass.new
|
19
19
|
resp.success = "The property is being imported from MLS. This may take a few minutes depending on how many images it has."
|
@@ -126,13 +126,13 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
126
126
|
#=============================================================================
|
127
127
|
|
128
128
|
def self.update_after(date_modified, save_images = true)
|
129
|
-
self.delay.update_helper('RES', date_modified, save_images)
|
130
|
-
self.delay.update_helper('COM', date_modified, save_images)
|
131
|
-
self.delay.update_helper('LND', date_modified, save_images)
|
132
|
-
self.delay.update_helper('MUL', date_modified, save_images)
|
133
|
-
self.delay.update_helper('OFF', date_modified, save_images)
|
134
|
-
self.delay.update_helper('AGT', date_modified, save_images)
|
135
|
-
self.delay.update_helper('OPH', date_modified, save_images)
|
129
|
+
self.delay(:queue => 'rets').update_helper('RES', date_modified, save_images)
|
130
|
+
self.delay(:queue => 'rets').update_helper('COM', date_modified, save_images)
|
131
|
+
self.delay(:queue => 'rets').update_helper('LND', date_modified, save_images)
|
132
|
+
self.delay(:queue => 'rets').update_helper('MUL', date_modified, save_images)
|
133
|
+
self.delay(:queue => 'rets').update_helper('OFF', date_modified, save_images)
|
134
|
+
self.delay(:queue => 'rets').update_helper('AGT', date_modified, save_images)
|
135
|
+
self.delay(:queue => 'rets').update_helper('OPH', date_modified, save_images)
|
136
136
|
end
|
137
137
|
|
138
138
|
def self.update_helper(class_type, date_modified, save_images = true)
|
@@ -149,13 +149,13 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
149
149
|
}
|
150
150
|
self.client.search(params) do |data|
|
151
151
|
case class_type
|
152
|
-
when 'RES' then self.delay(:priority => 10).import_residential_property( data[k], save_images)
|
153
|
-
when 'COM' then self.delay(:priority => 10).import_commercial_property( data[k], save_images)
|
154
|
-
when 'LND' then self.delay(:priority => 10).import_land_property( data[k], save_images)
|
155
|
-
when 'MUL' then self.delay(:priority => 10).import_multi_family_property( data[k], save_images)
|
156
|
-
when 'OFF' then self.delay(:priority => 10).import_office( data[k], save_images)
|
157
|
-
when 'AGT' then self.delay(:priority => 10).import_agent( data[k], save_images)
|
158
|
-
when 'OPH' then self.delay(:priority => 10).import_open_house( data[k], save_images)
|
152
|
+
when 'RES' then self.delay(:priority => 10, :queue => 'rets').import_residential_property( data[k], save_images)
|
153
|
+
when 'COM' then self.delay(:priority => 10, :queue => 'rets').import_commercial_property( data[k], save_images)
|
154
|
+
when 'LND' then self.delay(:priority => 10, :queue => 'rets').import_land_property( data[k], save_images)
|
155
|
+
when 'MUL' then self.delay(:priority => 10, :queue => 'rets').import_multi_family_property( data[k], save_images)
|
156
|
+
when 'OFF' then self.delay(:priority => 10, :queue => 'rets').import_office( data[k], save_images)
|
157
|
+
when 'AGT' then self.delay(:priority => 10, :queue => 'rets').import_agent( data[k], save_images)
|
158
|
+
when 'OPH' then self.delay(:priority => 10, :queue => 'rets').import_open_house( data[k], save_images)
|
159
159
|
end
|
160
160
|
end
|
161
161
|
end
|
@@ -309,7 +309,7 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
309
309
|
models.each do |model|
|
310
310
|
self.log "Updating coords #{names[i]} properties..."
|
311
311
|
model.where(:latitude => nil).reorder(:mls_acct).each do |p|
|
312
|
-
self.delay.update_coords(p)
|
312
|
+
self.delay(:queue => 'rets').update_coords(p)
|
313
313
|
end
|
314
314
|
i = i + 1
|
315
315
|
end
|
@@ -358,14 +358,14 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
358
358
|
self.purge_media
|
359
359
|
end
|
360
360
|
|
361
|
-
def self.purge_residential() self.delay.purge_helper('RES', '2012-01-01') end
|
362
|
-
def self.purge_commercial() self.delay.purge_helper('COM', '2012-01-01') end
|
363
|
-
def self.purge_land() self.delay.purge_helper('LND', '2012-01-01') end
|
364
|
-
def self.purge_multi_family() self.delay.purge_helper('MUL', '2012-01-01') end
|
365
|
-
def self.purge_offices() self.delay.purge_helper('OFF', '2012-01-01') end
|
366
|
-
def self.purge_agents() self.delay.purge_helper('AGT', '2012-01-01') end
|
367
|
-
def self.purge_open_houses() self.delay.purge_helper('OPH', '2012-01-01') end
|
368
|
-
def self.purge_media() self.delay.purge_helper('GFX', '2012-01-01') end
|
361
|
+
def self.purge_residential() self.delay(:queue => 'rets').purge_helper('RES', '2012-01-01') end
|
362
|
+
def self.purge_commercial() self.delay(:queue => 'rets').purge_helper('COM', '2012-01-01') end
|
363
|
+
def self.purge_land() self.delay(:queue => 'rets').purge_helper('LND', '2012-01-01') end
|
364
|
+
def self.purge_multi_family() self.delay(:queue => 'rets').purge_helper('MUL', '2012-01-01') end
|
365
|
+
def self.purge_offices() self.delay(:queue => 'rets').purge_helper('OFF', '2012-01-01') end
|
366
|
+
def self.purge_agents() self.delay(:queue => 'rets').purge_helper('AGT', '2012-01-01') end
|
367
|
+
def self.purge_open_houses() self.delay(:queue => 'rets').purge_helper('OPH', '2012-01-01') end
|
368
|
+
def self.purge_media() self.delay(:queue => 'rets').purge_helper('GFX', '2012-01-01') end
|
369
369
|
|
370
370
|
def self.purge_helper(class_type, date_modified)
|
371
371
|
m = self.meta(class_type)
|
@@ -421,14 +421,14 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
421
421
|
ids_to_add.each do |id|
|
422
422
|
self.log("- Importing #{id}...")
|
423
423
|
case class_type
|
424
|
-
when 'RES' then self.delay.import_residential_property(id, false)
|
425
|
-
when 'COM' then self.delay.import_commercial_property(id, false)
|
426
|
-
when 'LND' then self.delay.import_land_property(id, false)
|
427
|
-
when 'MUL' then self.delay.import_multi_family_property(id, false)
|
428
|
-
when 'OFF' then self.delay.import_office(id, false)
|
429
|
-
when 'AGT' then self.delay.import_agent(id, false)
|
430
|
-
when 'OPH' then self.delay.import_open_house(id, false)
|
431
|
-
when 'GFX' then self.delay.import_media(id, false)
|
424
|
+
when 'RES' then self.delay(:queue => 'rets').import_residential_property(id, false)
|
425
|
+
when 'COM' then self.delay(:queue => 'rets').import_commercial_property(id, false)
|
426
|
+
when 'LND' then self.delay(:queue => 'rets').import_land_property(id, false)
|
427
|
+
when 'MUL' then self.delay(:queue => 'rets').import_multi_family_property(id, false)
|
428
|
+
when 'OFF' then self.delay(:queue => 'rets').import_office(id, false)
|
429
|
+
when 'AGT' then self.delay(:queue => 'rets').import_agent(id, false)
|
430
|
+
when 'OPH' then self.delay(:queue => 'rets').import_open_house(id, false)
|
431
|
+
when 'GFX' then self.delay(:queue => 'rets').import_media(id, false)
|
432
432
|
end
|
433
433
|
end
|
434
434
|
|
@@ -483,14 +483,14 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
483
483
|
ids_to_add.each do |id|
|
484
484
|
self.log("Importing #{id}...")
|
485
485
|
case class_type
|
486
|
-
when 'RES' then self.delay.import_residential_property(id, false)
|
487
|
-
when 'COM' then self.delay.import_commercial_property(id, false)
|
488
|
-
when 'LND' then self.delay.import_land_property(id, false)
|
489
|
-
when 'MUL' then self.delay.import_multi_family_property(id, false)
|
490
|
-
when 'OFF' then self.delay.import_office(id, false)
|
491
|
-
when 'AGT' then self.delay.import_agent(id, false)
|
492
|
-
when 'OPH' then self.delay.import_open_house(id, false)
|
493
|
-
when 'GFX' then self.delay.import_media(id)
|
486
|
+
when 'RES' then self.delay(:queue => 'rets').import_residential_property(id, false)
|
487
|
+
when 'COM' then self.delay(:queue => 'rets').import_commercial_property(id, false)
|
488
|
+
when 'LND' then self.delay(:queue => 'rets').import_land_property(id, false)
|
489
|
+
when 'MUL' then self.delay(:queue => 'rets').import_multi_family_property(id, false)
|
490
|
+
when 'OFF' then self.delay(:queue => 'rets').import_office(id, false)
|
491
|
+
when 'AGT' then self.delay(:queue => 'rets').import_agent(id, false)
|
492
|
+
when 'OPH' then self.delay(:queue => 'rets').import_open_house(id, false)
|
493
|
+
when 'GFX' then self.delay(:queue => 'rets').import_media(id)
|
494
494
|
end
|
495
495
|
end
|
496
496
|
end
|
@@ -556,7 +556,7 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
556
556
|
q = "handler like '%update_rets%'"
|
557
557
|
count = Delayed::Job.where(q).count
|
558
558
|
if count == 0 || (count == 1 && Delayed::Job.where(q).first.locked_at)
|
559
|
-
self.delay(:run_at => 5.minutes.from_now).update_rets
|
559
|
+
self.delay(:run_at => 5.minutes.from_now, :queue => 'rets').update_rets
|
560
560
|
end
|
561
561
|
end
|
562
562
|
|
data/lib/caboose_rets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-rets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: caboose-cms
|