caboose-rets 0.1.187 → 0.1.191

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
  SHA256:
3
- metadata.gz: 936a3227a63e02f4e6fdecdedd4113d43efbbbff3bcc514949fdc1c172116488
4
- data.tar.gz: 7d6b834190be3bc8639ee9bb98181a2dffcb14877972ff04fee70d2ea1b94968
3
+ metadata.gz: a2fc7fbb6f605500f900eb5625e09397dfe0f64eef3ccef6ad71724f2f828b02
4
+ data.tar.gz: f5c15dbb38706eafa7b16b41bb5446ba74bc591d5c29ab8a4f59a3730d861681
5
5
  SHA512:
6
- metadata.gz: 9d261fa947e2ca6965d3c8a373f29b6285c8e3cdb5e6dc415dcf2e9e68120f0065d6e27906a39299343f2db7ebf045ddf3e0db9ac18110fe10e993ba15fa95d6
7
- data.tar.gz: 9e59c90155e5b19d4c2ee691cc7a76eb950eaa9b8c407736aa4d380350c40321c6874e5b3b86b8007f0e08e28bee417daaa2b014e2d677a600f312df9e3b83d8
6
+ metadata.gz: 81166c1c9d6d5f749f097a154a314e8356ca22a6fcbbea7c9cdf4a4fb783bd616d2dfea38704fa577addef1d8e722dd21156a8cceac2ab2237a446f248e773bf
7
+ data.tar.gz: 321d54398c54ca8a356208108a9eab3f08a2e6351544e0cee22d119b6074e748b0063cc626e9b8fac5544881dcf538b05448e1929f6ef3d52a57538032df350d
@@ -40,7 +40,7 @@ class CabooseRets::Agent < ActiveRecord::Base
40
40
  CabooseRets::RetsImporter.import_agent(self.mls_id)
41
41
  end
42
42
 
43
- # Sends a SMS to the agent (using Twilio) notifying them that a new user has registered and been assigned to them
43
+ # Sends a SMS to the agent (using Twilio) notifying them that a new user has registered and been assigned to them.
44
44
  def send_text(message, site_id)
45
45
  s1 = Caboose::Setting.where(:site_id => site_id, :name => "twilio_account_sid").first
46
46
  account_sid = s1 ? s1.value : nil
@@ -18,7 +18,7 @@ class CabooseRets::Notification < ActiveRecord::Base
18
18
  user_ids.each do |user_id|
19
19
  user = Caboose::User.where(uwhere).where(:id => user_id, :tax_exempt => false).first
20
20
  d1 = DateTime.now - 24.hours
21
- if user && user.site && user.site.use_rets
21
+ if user && user.site && user.site.use_rets && !Caboose::BouncedEmail.where(:email_address => user.email).exists?
22
22
  # Check if a similar notification has already been sent
23
23
  n = CabooseRets::Notification.where(
24
24
  :user_id => user.id,
@@ -64,7 +64,7 @@ class CabooseRets::Notification < ActiveRecord::Base
64
64
  user_ids.each do |user_id|
65
65
  user = Caboose::User.where(uwhere).where(:id => user_id, :tax_exempt => false).first
66
66
  d1 = DateTime.now - 24.hours
67
- if user && user.site && user.site.use_rets
67
+ if user && user.site && user.site.use_rets && !Caboose::BouncedEmail.where(:email_address => user.email).exists?
68
68
  # Check if a similar notification has already been sent
69
69
  n = CabooseRets::Notification.where(
70
70
  :user_id => user.id,
@@ -115,6 +115,8 @@ class CabooseRets::Notification < ActiveRecord::Base
115
115
 
116
116
  users.each do |user|
117
117
 
118
+ next if user.email.blank? || Caboose::BouncedEmail.where(:email_address => user.email).exists?
119
+
118
120
  puts "Gathering data for user: #{user.username}" if Rails.env.development?
119
121
 
120
122
  saved_mls = CabooseRets::SavedProperty.where(:user_id => user.id).pluck(:mls_number)
@@ -454,7 +454,7 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
454
454
  ids_to_remove = local_ids - ids
455
455
  self.log3(class_type,nil,"Found #{ids_to_remove.count} #{class_type} records in the local database that are not in the remote database.")
456
456
 
457
- # Delete all RetsMedia and CabooseMedia for the deleted property listings (except keep the first image)
457
+ # Delete all RetsMedia and CabooseMedia for the deleted property listings (except keep the first image)
458
458
  if class_type == 'Property' && ids_to_remove && ids_to_remove.count > 0
459
459
  self.log3(class_type,nil,"Deleting Media objects that shouldn't be there...")
460
460
  muis = CabooseRets::Property.where("#{k} in (?)", ids_to_remove).pluck(:matrix_unique_id)
@@ -472,6 +472,10 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
472
472
  self.log3(class_type,nil,"Deleting #{class_type} records in the local database that shouldn't be there...")
473
473
  query = ["delete from #{t} where #{k} in (?)", ids_to_remove]
474
474
  ActiveRecord::Base.connection.execute(ActiveRecord::Base.send(:sanitize_sql_array, query))
475
+ else # mark deleted properties as Deleted status
476
+ self.log3(class_type,nil,"Setting deleted properties as Deleted status...")
477
+ query = ["update #{t} set status = ? where #{k} in (?)", "Deleted", ids_to_remove]
478
+ ActiveRecord::Base.connection.execute(ActiveRecord::Base.send(:sanitize_sql_array, query))
475
479
  end
476
480
 
477
481
  # Find any ids in the remote database that should be in the local database
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.187'
2
+ VERSION = '0.1.191'
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.187
4
+ version: 0.1.191
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-12 00:00:00.000000000 Z
11
+ date: 2022-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: caboose-cms