caboose-rets 0.1.25 → 0.1.26

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: e857e0eae9ea7efd5fb52056149ab05f4a7b3c96
4
- data.tar.gz: 4820e0bc50d32128f67d7d1d220fbc69a889d64e
3
+ metadata.gz: 254faba117caf0a31d78445efc80d351b8604cfc
4
+ data.tar.gz: e102328e3e15d0b70fc42fbb0d0221f05aa1c329
5
5
  SHA512:
6
- metadata.gz: 472d4056bc642fd14d6b2518ed81938f7145f187905295b6d8ab07882e5b49e23a8a3ea171a9ac70a83cef85806dc68fd554bc6c2c289e0d1488ffa9d1dc6f63
7
- data.tar.gz: 2105cbfe1b38253048b77401626ecbcc27599cfd53c94164b7047adfaf4c58e4673a4783f870a71aeeb4ddb1015c195d755311e9fb3bbb9c84f28f0a4b0477b1
6
+ metadata.gz: b789e6caadc04bbcfb3786148b0493fac621cbdab04337be83d9684b2a3e44b33eabc964df9a23d6af2e9a466f4d0f9002176a26cc7542b07f2cd7dee3921f24
7
+ data.tar.gz: f862d4548e70f064e333d2499dce183d713af35a8cd55e8024720115fcaf27ad77245da088c747bdddde3a7f8450034742206c5348032d3c1905d406d52ce723
@@ -94,7 +94,7 @@ module CabooseRets
94
94
  @saved = logged_in? && SavedProperty.where(:user_id => logged_in_user.id, :mls_number => params[:mls_number]).exists?
95
95
  if @property.nil?
96
96
  @mls_number = params[:mls_number]
97
- CabooseRets::RetsImporter.delay(:priority => 10, :queue => 'rets').import_property(@mls_number.to_i)
97
+ # CabooseRets::RetsImporter.delay(:priority => 10, :queue => 'rets').import_property(@mls_number.to_i)
98
98
  render 'properties/property_not_exists'
99
99
  return
100
100
  end
@@ -109,7 +109,7 @@ module CabooseRets
109
109
 
110
110
  if @property.nil?
111
111
  @mls = params[:mls]
112
- CabooseRets::RetsImporter.delay(:priority => 10, :queue => 'rets').import_property(@mls_number.to_i)
112
+ # CabooseRets::RetsImporter.delay(:priority => 10, :queue => 'rets').import_property(@mls_number.to_i)
113
113
  render 'properties/property_not_exists'
114
114
  return
115
115
  end
@@ -12,11 +12,11 @@ module CabooseRets
12
12
  def admin_import
13
13
  return if !user_is_allowed('properties', 'edit')
14
14
 
15
- mls = params[:mls].to_i
16
- CabooseRets::RetsImporter.delay(:priority => 10, :queue => 'rets').import_property(mls)
15
+ mui = params[:mls]
16
+ CabooseRets::RetsImporter.delay(:priority => 10, :queue => 'rets').import_properties(mui)
17
17
 
18
18
  resp = Caboose::StdClass.new
19
- resp.success = "The property is being imported from MLS. This may take a few minutes depending on how many images it has."
19
+ resp.success = "The property is being imported from Matrix. This may take a few minutes depending on how many images it has."
20
20
  render :json => resp
21
21
  end
22
22
 
@@ -29,14 +29,14 @@ class CabooseRets::Agent < ActiveRecord::Base
29
29
  end
30
30
  end
31
31
 
32
- def refresh_from_mls
33
- CabooseRets::RetsImporter.import('Listing',"(Matrix_Unique_ID=#{self.matrix_unique_id})")
32
+ def refresh_from_mls
33
+ CabooseRets::RetsImporter.import('Agent',"(Matrix_Unique_ID=#{self.matrix_unique_id})")
34
34
  CabooseRets::RetsImporter.download_property_images(self)
35
35
  end
36
36
 
37
37
  def self.refresh_from_mls(agent_number)
38
38
  CabooseRets::RetsImporter.import('Agent', "(Agent_Number=#{self.agent_number})")
39
- CabooseRets::RetsImporter.import_property(matrix_unique_id)
39
+ CabooseRets::RetsImporter.import_agent(self.matrix_unique_id)
40
40
  end
41
41
 
42
42
  def parse(data)
@@ -13,7 +13,7 @@ class CabooseRets::Property <ActiveRecord::Base
13
13
  def self.geolocatable() all(conditions: "latitude IS NOT NULL AND longitude IS NOT NULL") end
14
14
 
15
15
  def refresh_from_mls
16
- CabooseRets::RetsImporter.import_property(self.matrix_unique_id)
16
+ CabooseRets::RetsImporter.import_properties(self.matrix_unique_id, false)
17
17
  end
18
18
 
19
19
  def parse(data)
@@ -151,9 +151,14 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
151
151
  #=============================================================================
152
152
 
153
153
  # def self.import_property(mui, save_images = true)
154
- # self.import('Listinng', "(Matrix_Unique_ID=*#{mui}*)")
155
- # p = CabooseRets::Property.where(:id => id.to_i).first
156
- # self.download_property_images(p, save_images)
154
+ # self.import('Listing', "(Matrix_Unique_ID=#{mui})")
155
+ # p = CabooseRets::Property.where(:matrix_unique_id => mui.to_s).first
156
+ # if p != nil
157
+ # self.download_property_images(p)
158
+ # self.update_coords(p)
159
+ # else
160
+ # self.log("No Property associated with #{mui}")
161
+ # end
157
162
  # end
158
163
 
159
164
  def self.import_properties(mui, save_images = true)
@@ -1,8 +1,8 @@
1
- <h1>Import Property from MLS</h1>
1
+ <h1>Import Property from Matrix</h1>
2
2
 
3
3
  <form action='/admin/rets/import' method='post' id='import_form' onsubmit="import_property(); return false;">
4
4
  <input type='hidden' name='authenticity_token' value='<%= form_authenticity_token %>' />
5
- <p><input type='text' name='mls' id='mls' placeholder='MLS #' value="" style='width: 300px;' /></p>
5
+ <p><input type='text' name='mls' id='mls' placeholder='Matrix Unique ID #' value="" style='width: 300px;' /></p>
6
6
  <div id='message'></div>
7
7
  <p><input type='submit' value='Import Property' /></p>
8
8
  </form>
@@ -12,7 +12,7 @@
12
12
 
13
13
  function import_property()
14
14
  {
15
- $('#message').html("<p class='loading'>Importing property from MLS...</p>");
15
+ $('#message').html("<p class='loading'>Importing property from Matrix...</p>");
16
16
  $.ajax({
17
17
  url: '/admin/rets/import',
18
18
  type: 'post',
@@ -25,4 +25,4 @@ function import_property()
25
25
  }
26
26
 
27
27
  </script>
28
- <% end %>
28
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.25'
2
+ VERSION = '0.1.26'
3
3
  end
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.25
4
+ version: 0.1.26
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-09-06 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caboose-cms