caboose-rets 0.1.24 → 0.1.25
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/properties_controller.rb +3 -3
- data/app/models/caboose_rets/property.rb +7 -7
- data/app/models/caboose_rets/rets_importer.rb +2 -2
- data/app/models/caboose_rets/schema.rb +7 -7
- data/lib/caboose_rets/version.rb +1 -1
- data/lib/tasks/caboose_rets.rake +2 -2
- 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: e857e0eae9ea7efd5fb52056149ab05f4a7b3c96
|
4
|
+
data.tar.gz: 4820e0bc50d32128f67d7d1d220fbc69a889d64e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 472d4056bc642fd14d6b2518ed81938f7145f187905295b6d8ab07882e5b49e23a8a3ea171a9ac70a83cef85806dc68fd554bc6c2c289e0d1488ffa9d1dc6f63
|
7
|
+
data.tar.gz: 2105cbfe1b38253048b77401626ecbcc27599cfd53c94164b7047adfaf4c58e4673a4783f870a71aeeb4ddb1015c195d755311e9fb3bbb9c84f28f0a4b0477b1
|
@@ -12,7 +12,7 @@ module CabooseRets
|
|
12
12
|
|
13
13
|
# @route GET /properties
|
14
14
|
def index
|
15
|
-
params[:
|
15
|
+
params[:street_number_like] = params[:street_name_like].tr('A-z', '').tr(' ', '') unless params[:street_name_like].nil?
|
16
16
|
unless params[:street_name_like].nil?
|
17
17
|
params[:street_name_like] = params[:street_name_like].tr('0-9', "")
|
18
18
|
until params[:street_name_like][0] != " " || params[:street_name_like] == ''
|
@@ -55,7 +55,7 @@ module CabooseRets
|
|
55
55
|
'foreclosure_yn' => '',
|
56
56
|
'address_like' => '',
|
57
57
|
'street_name_like' => '',
|
58
|
-
'
|
58
|
+
'street_number_like' => '',
|
59
59
|
'postal_code' => '',
|
60
60
|
'postal_code_like' => '',
|
61
61
|
'status' => 'Active'
|
@@ -64,7 +64,7 @@ module CabooseRets
|
|
64
64
|
'sort' => CabooseRets::default_property_sort,
|
65
65
|
'desc' => false,
|
66
66
|
'abbreviations' => {
|
67
|
-
'address_like' => '
|
67
|
+
'address_like' => 'street_number_concat_street_name_like'
|
68
68
|
},
|
69
69
|
'skip' => ['status'],
|
70
70
|
'base_url' => '/properties',
|
@@ -18,7 +18,7 @@ class CabooseRets::Property <ActiveRecord::Base
|
|
18
18
|
|
19
19
|
def parse(data)
|
20
20
|
self.access = data['Access']
|
21
|
-
self.acreage = data['Acreage']
|
21
|
+
self.acreage = data['Acreage'].blank? ? nil : data['Acreage'].to_f
|
22
22
|
self.acreage_source = data['AcreageSource']
|
23
23
|
self.active_open_house_count = data['ActiveOpenHouseCount']
|
24
24
|
self.adjoining_land_use = data['AdjoiningLandUse']
|
@@ -30,10 +30,10 @@ class CabooseRets::Property <ActiveRecord::Base
|
|
30
30
|
self.available_date = data['AvailableDate']
|
31
31
|
self.basement = data['Basement']
|
32
32
|
self.basement_yn = data['BasementYN']
|
33
|
-
self.baths_full = data['BathsFull']
|
34
|
-
self.baths_half = data['BathsHalf']
|
35
|
-
self.baths_total = data['BathsTotal']
|
36
|
-
self.beds_total = data['BedsTotal']
|
33
|
+
self.baths_full = data['BathsFull'].blank? ? nil : data['BathsFull'].to_i
|
34
|
+
self.baths_half = data['BathsHalf'].blank? ? nil : data['BathsHalf'].to_i
|
35
|
+
self.baths_total = data['BathsTotal'].blank? ? nil : data['BathsTotal'].to_f
|
36
|
+
self.beds_total = data['BedsTotal'].blank? ? nil : data['BedsTotal'].to_i
|
37
37
|
self.book_number = data['BookNumber']
|
38
38
|
self.book_page = data['BookPage']
|
39
39
|
self.book_type = data['BookType']
|
@@ -110,7 +110,7 @@ class CabooseRets::Property <ActiveRecord::Base
|
|
110
110
|
self.list_office_mls_id = data['ListOfficeMLSID']
|
111
111
|
self.list_office_name = data['ListOfficeName']
|
112
112
|
self.list_office_phone = data['ListOfficePhone']
|
113
|
-
self.list_price = data['ListPrice']
|
113
|
+
self.list_price = data['ListPrice'].blank? ? nil : data['ListPrice'].to_f
|
114
114
|
self.lot_description = data['LotDescription']
|
115
115
|
self.lot_dimensions = data['LotDimensions']
|
116
116
|
self.lot_dim_source = data['LotDimSource']
|
@@ -164,7 +164,7 @@ class CabooseRets::Property <ActiveRecord::Base
|
|
164
164
|
self.sold_terms = data['SoldTerms']
|
165
165
|
self.sprinkler = data['Sprinkler']
|
166
166
|
self.sqft_source = data['SqftSource']
|
167
|
-
self.sqft_total = data['SqFtTotal']
|
167
|
+
self.sqft_total = data['SqFtTotal'].blank? ? nil : data['SqFtTotal'].to_f
|
168
168
|
self.state_or_province = data['StateOrProvince']
|
169
169
|
self.status = data['Status']
|
170
170
|
self.status_contractual_search_date = data['StatusContractualSearchDate']
|
@@ -528,11 +528,11 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
528
528
|
end
|
529
529
|
|
530
530
|
# Start the same update process in five minutes
|
531
|
-
self.log2("Adding the update rets task for
|
531
|
+
self.log2("Adding the update rets task for 20 minutes from now...")
|
532
532
|
q = "handler like '%update_rets%'"
|
533
533
|
count = Delayed::Job.where(q).count
|
534
534
|
if count == 0 || (count == 1 && Delayed::Job.where(q).first.locked_at)
|
535
|
-
self.delay(:run_at =>
|
535
|
+
self.delay(:run_at => 20.minutes.from_now, :priority => 10, :queue => 'rets').update_rets
|
536
536
|
end
|
537
537
|
end
|
538
538
|
|
@@ -96,7 +96,7 @@ class CabooseRets::Schema < Caboose::Utilities::Schema
|
|
96
96
|
],
|
97
97
|
CabooseRets::Property => [
|
98
98
|
[ :access , :text],
|
99
|
-
[ :acreage , :
|
99
|
+
[ :acreage , :decimal],
|
100
100
|
[ :acreage_source , :text],
|
101
101
|
[ :active_open_house_count , :text],
|
102
102
|
[ :adjoining_land_use , :text],
|
@@ -108,10 +108,10 @@ class CabooseRets::Schema < Caboose::Utilities::Schema
|
|
108
108
|
[ :available_date , :text],
|
109
109
|
[ :basement , :text],
|
110
110
|
[ :basement_yn , :text],
|
111
|
-
[ :baths_full , :
|
112
|
-
[ :baths_half , :
|
113
|
-
[ :baths_total , :
|
114
|
-
[ :beds_total , :
|
111
|
+
[ :baths_full , :integer],
|
112
|
+
[ :baths_half , :integer],
|
113
|
+
[ :baths_total , :decimal],
|
114
|
+
[ :beds_total , :integer],
|
115
115
|
[ :book_number , :text],
|
116
116
|
[ :book_page , :text],
|
117
117
|
[ :book_type , :text],
|
@@ -193,7 +193,7 @@ class CabooseRets::Schema < Caboose::Utilities::Schema
|
|
193
193
|
[ :list_office_mls_id , :text],
|
194
194
|
[ :list_office_name , :text],
|
195
195
|
[ :list_office_phone , :text],
|
196
|
-
[ :list_price , :
|
196
|
+
[ :list_price , :decimal],
|
197
197
|
[ :longitude , :text],
|
198
198
|
[ :lot_description , :text],
|
199
199
|
[ :lot_dimensions , :text],
|
@@ -248,7 +248,7 @@ class CabooseRets::Schema < Caboose::Utilities::Schema
|
|
248
248
|
[ :sold_terms , :text],
|
249
249
|
[ :sprinkler , :text],
|
250
250
|
[ :sqft_source , :text],
|
251
|
-
[ :sqft_total , :
|
251
|
+
[ :sqft_total , :decimal],
|
252
252
|
[ :state_or_province , :text],
|
253
253
|
[ :status , :text],
|
254
254
|
[ :status_contractual_search_date , :text],
|
data/lib/caboose_rets/version.rb
CHANGED
data/lib/tasks/caboose_rets.rake
CHANGED
@@ -61,7 +61,7 @@ namespace :caboose_rets do
|
|
61
61
|
|
62
62
|
desc "Import Image"
|
63
63
|
task :img => :environment do
|
64
|
-
p = CabooseRets::Property.where(:matrix_unique_id => "
|
64
|
+
p = CabooseRets::Property.where(:matrix_unique_id => "9233280").first
|
65
65
|
CabooseRets::RetsImporter.download_property_images(p)
|
66
66
|
end
|
67
67
|
|
@@ -75,7 +75,7 @@ namespace :caboose_rets do
|
|
75
75
|
|
76
76
|
desc "Single Import Test"
|
77
77
|
task :import_one => :environment do
|
78
|
-
CabooseRets::RetsImporter.import_properties('
|
78
|
+
CabooseRets::RetsImporter.import_properties('9233280' , "(Matrix_Unique_ID=9233280)")
|
79
79
|
end
|
80
80
|
|
81
81
|
desc "Purge rets data"
|
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.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: caboose-cms
|