caboose-rets 0.1.186 → 0.1.190

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: 53638239457a0163c6335496fd1bb29363c5776995bd5506b830151f1467ff67
4
- data.tar.gz: 521d13e87659cf69eb8c8d81dd6f35f250546df44ce93c4a843d117cf1ecf66a
3
+ metadata.gz: ba197a8a09fdd08aeefc0f6d1bb13dfd5410f97eb25249f1498fa6411e3c05e8
4
+ data.tar.gz: 1a4bbe9b9ad35906499d1e021a775762c04ddbe3fb4294f2b26a10da08c4b836
5
5
  SHA512:
6
- metadata.gz: 2de2b0504e3d274d75cb97d18067827b53cf045a6a59baec3a2b820642f3e6a5cf786e428ebf3f92358aa92cbad3a55eabe72a006db465176f72ab80ae2347ef
7
- data.tar.gz: 02311a373fb031bb38baab831a2a6fd2a17ea354048b146736577a06ac996019687d8851ef4bd9c605edfb5543f97def70e898774b36d0c280c78076a0478b8c
6
+ metadata.gz: e2c206068e797bccfed67061a0ee6d738f0273e92ebd786349c8abda9ef20c6ee4ad459840359a1360c5ad5243620522f51c617e29ab737723aee084779e5896
7
+ data.tar.gz: 6bcb2fa742b528db155bcceb5a4a5458ac3237e08bffdd834e7476ce77b7107ec1e8880ad3c82297ed21c49ad068e64b9eb4635bb4762d385da87695e8d4f0be
@@ -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)
@@ -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
@@ -17,7 +17,7 @@
17
17
  <p style="margin:0 0 5px 0;font-size:16px;line-height:18px;"><strong><%= number_to_currency(p.list_price, :precision => 0) %></strong></p>
18
18
  <p style="margin:0 0 5px 0;font-size:15px;line-height:17px;">
19
19
  <% if !p.beds_total.blank? %><span><strong><%= p.beds_total %></strong> beds</span><br /><% end %>
20
- <% if !p.baths_full.blank? %><span><strong><%= p.baths_full %>&nbsp;<% if !p.baths_half.blank? && p.baths_half > 0 %><%= p.baths_half %>&nbsp;½<% end %></strong>baths</span><br /><% end %>
20
+ <% if !p.baths_full.blank? %><span><strong><%= p.baths_full %>&nbsp;<% if p.baths_half == 1 %>½&nbsp;<% end %></strong>baths</span><br /><% end %>
21
21
  <% if !p.sqft_total.blank? %><span><strong><%= number_with_delimiter(p.sqft_total.to_i, :delimiter => ',') %></strong> sqft</span><% end %>
22
22
  </p>
23
23
  <% if !p.original_entry_timestamp.blank? %>
@@ -1,3 +1,3 @@
1
1
  module CabooseRets
2
- VERSION = '0.1.186'
2
+ VERSION = '0.1.190'
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.186
4
+ version: 0.1.190
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