caboose-rets 0.0.68 → 0.0.69
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 +8 -8
- data/app/models/caboose_rets/rets_importer.rb +39 -14
- data/lib/caboose_rets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjRhYzQ1ZWY3YjMzZmFhNzYwZjFhNTUyNzk2NjU5OWRlZjNhN2FiNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmNmMzg1NDMzZTQxZGViZWE0OTZmNzBjYzFkY2ZhZjQ5MGRiYzA1Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzE2YzRjODQ2MjU2ZGE1YzA2MTRmZjI2OGMxMWVmNzg2YWQzNGYwMmE0NGVm
|
10
|
+
ZDc0MzJmN2E5YjZjMTkwOTgwZTZmNzk5NWExYmVmODRkMjg5NjUwZDIxNzhj
|
11
|
+
NWQ3NDkwZDJmYTIyN2EzYTIwZWI3MWZjY2YwMzY0NGI3NDI4ZTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzFiMDQ1ZGI5NTA0NWI1NTI3NmFmYjgwNTBiMDZhY2I2NjI3YjllZGM4NDlh
|
14
|
+
MzI0NmU4YmYzODIxYWMxOWExMGU0YmM2ODFkMmQ4MGQxOWQ2NzIzYmU0MzY0
|
15
|
+
NzEwZDIyNmVlZDEzNTE5OWEzYzY3MTNiZjVjMmUxNGZkNGU1OTk=
|
@@ -221,7 +221,21 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
221
221
|
end
|
222
222
|
|
223
223
|
def self.import_media(id, save_images = true)
|
224
|
-
self.import('GFX', "((MEDIA_ID=#{id}+),(MEDIA_ID=#{id}-))")
|
224
|
+
self.import('GFX', "((MEDIA_ID=#{id}+),(MEDIA_ID=#{id}-))")
|
225
|
+
#self.client.get_object(:resource => :Property, :type => :Photo, :location => true, :id => p.id) do |headers, content|
|
226
|
+
#
|
227
|
+
# # Find the associated media record for the image
|
228
|
+
# filename = File.basename(headers['location'])
|
229
|
+
# m = CabooseRets::Media.where(:mls_acct => p.mls_acct, :file_name => filename).first
|
230
|
+
#
|
231
|
+
# if m.nil?
|
232
|
+
# self.log("Can't find media record for #{p.mls_acct} #{filename}.")
|
233
|
+
# else
|
234
|
+
# m.image = URI.parse(headers['location'])
|
235
|
+
# media << m
|
236
|
+
# #m.save
|
237
|
+
# end
|
238
|
+
#end
|
225
239
|
end
|
226
240
|
|
227
241
|
#=============================================================================
|
@@ -384,7 +398,18 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
384
398
|
ids = []
|
385
399
|
k = m.remote_key_field
|
386
400
|
(0...batch_count).each do |i|
|
387
|
-
self.client.search(params.merge({ :select => [k], :limit => 5000, :offset => 5000*i }))
|
401
|
+
self.client.search(params.merge({ :select => [k], :limit => 5000, :offset => 5000*i })) do |data|
|
402
|
+
ids << case class_type
|
403
|
+
when 'RES' then data[k]
|
404
|
+
when 'COM' then data[k]
|
405
|
+
when 'LND' then data[k]
|
406
|
+
when 'MUL' then data[k]
|
407
|
+
when 'OFF' then data[k]
|
408
|
+
when 'AGT' then data[k]
|
409
|
+
when 'OPH' then data[k].to_i
|
410
|
+
when 'GFX' then data[k]
|
411
|
+
end
|
412
|
+
end
|
388
413
|
end
|
389
414
|
|
390
415
|
# Delete any records in the local database that shouldn't be there
|
@@ -401,13 +426,13 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
401
426
|
ids_to_add.each do |id|
|
402
427
|
puts "Importing #{id}..."
|
403
428
|
case class_type
|
404
|
-
when 'RES' then self.delay.import_residential_property(id)
|
405
|
-
when 'COM' then self.delay.import_commercial_property(id)
|
406
|
-
when 'LND' then self.delay.import_land_property(id)
|
407
|
-
when 'MUL' then self.delay.import_multi_family_property(id)
|
408
|
-
when 'OFF' then self.delay.import_office(id)
|
409
|
-
when 'AGT' then self.delay.import_agent(id)
|
410
|
-
when 'OPH' then self.delay.import_open_house(id)
|
429
|
+
when 'RES' then self.delay.import_residential_property(id, false)
|
430
|
+
when 'COM' then self.delay.import_commercial_property(id, false)
|
431
|
+
when 'LND' then self.delay.import_land_property(id, false)
|
432
|
+
when 'MUL' then self.delay.import_multi_family_property(id, false)
|
433
|
+
when 'OFF' then self.delay.import_office(id, false)
|
434
|
+
when 'AGT' then self.delay.import_agent(id, false)
|
435
|
+
when 'OPH' then self.delay.import_open_house(id, false)
|
411
436
|
when 'GFX' then self.delay.import_media(id)
|
412
437
|
end
|
413
438
|
end
|
@@ -433,11 +458,11 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
433
458
|
|
434
459
|
begin
|
435
460
|
overlap = 30.seconds
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
461
|
+
if (DateTime.now - self.last_purged).to_i > 1
|
462
|
+
self.purge
|
463
|
+
self.save_last_purged(task_started)
|
464
|
+
#overlap = 1.month
|
465
|
+
end
|
441
466
|
self.update_after(self.last_updated - overlap)
|
442
467
|
self.save_last_updated(task_started)
|
443
468
|
self.unlock_task
|
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.0.
|
4
|
+
version: 0.0.69
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: caboose-cms
|