dorsale 3.7.5 → 3.7.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad479d894fe508bd2db24dbcb03d17c986fd482b
4
- data.tar.gz: 1122ddf76aabb70beab2c05c4807051b12d35e33
3
+ metadata.gz: 81e50babe312e2efc734c4f4a8d7f0330a9d202b
4
+ data.tar.gz: 288ebe8ef980c2757c47371d8f31c149b0b0136f
5
5
  SHA512:
6
- metadata.gz: 215f9de605cb95f630c71f709c514e617c8c942bcd22af69411a295900efdfb818b1ef7ae1a392dc5c5d13697c5756d13f1bd064e0ef6ef999e9fa1f59f9c3de
7
- data.tar.gz: 45b40e12c35892c1a2741a70210195746737105bd673bb08543332e237a3ea3b48387c6a00ec9409f81f8c460f93f0ebdfad6299c4d758954d00e6ba95901b6f
6
+ metadata.gz: 7aee6d4aad771859b4a6d695ae10f616b48bf7d0052e704103b861131fb3c8025b780a54dea643250cff7feae0af11fad2fe2623db6b9dd57bf82a9af20b1938
7
+ data.tar.gz: 6cd4a6e643628440fb561f3dd1c31373b12dac4ca94de30ccf1ea9cb651aa9180bb37f97e9c2c70b55a369db79a3a4c438c4c4471942f2864c2609e76c44c682
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 3.7.6
6
+
7
+ - Add table names on SQL queries
8
+
5
9
  ## 3.7.5
6
10
 
7
11
  - Task improvements
@@ -1,7 +1,7 @@
1
1
  class Dorsale::BillingMachine::SmallData::FilterStrategyByState < ::Agilibox::SmallData::FilterStrategy
2
2
  def apply(query, value)
3
3
  if value.to_s.match(/not_(.+)/)
4
- query.where("state != ?", $~[1])
4
+ query.where.not(state: $~[1])
5
5
  else
6
6
  query.where(state: value)
7
7
  end
@@ -34,8 +34,9 @@ module Dorsale::BillingMachine::ApplicationHelper
34
34
  end
35
35
 
36
36
  def billing_machine_invoices_chart
37
- invoices = policy_scope(::Dorsale::BillingMachine::Invoice)
38
- .where("date > ?", 1.year.ago.beginning_of_month)
37
+ model = ::Dorsale::BillingMachine::Invoice
38
+ invoices = policy_scope(model)
39
+ .where("#{model.table_name}.date > ?", 1.year.ago.beginning_of_month)
39
40
 
40
41
  totals = {}
41
42
 
@@ -29,41 +29,41 @@ class Dorsale::Flyboy::Task < ::Dorsale::ApplicationRecord
29
29
 
30
30
  scope :ontime, -> {
31
31
  undone
32
- .where("term IS NULL OR term > ?", Time.zone.now.to_date)
33
- .where("reminder_date IS NULL OR reminder_date > ?", Time.zone.now.to_date)
32
+ .where("#{table_name}.term IS NULL OR #{table_name}.term > ?", Time.zone.now.to_date)
33
+ .where("#{table_name}.reminder_date IS NULL OR #{table_name}.reminder_date > ?", Time.zone.now.to_date)
34
34
  }
35
35
 
36
36
  scope :onwarning, -> {
37
37
  undone
38
- .where("reminder_date <= ?", Time.zone.now.to_date)
39
- .where("term IS NULL OR term > ?", Time.zone.now.to_date)
38
+ .where("#{table_name}.reminder_date <= ?", Time.zone.now.to_date)
39
+ .where("#{table_name}.term IS NULL OR #{table_name}.term > ?", Time.zone.now.to_date)
40
40
  }
41
41
 
42
42
  scope :onalert, -> {
43
43
  undone
44
- .where("term <= ?", Time.zone.now.to_date)
44
+ .where("#{table_name}.term <= ?", Time.zone.now.to_date)
45
45
  }
46
46
 
47
- scope :delayed, -> { where(done: false).where("term < ?", Time.zone.now.to_date) }
48
- scope :today, -> { where(done: false).where("term = ?", Time.zone.now.to_date) }
49
- scope :tomorrow, -> { where(done: false).where("term = ?", Date.tomorrow) }
47
+ scope :delayed, -> { where(done: false).where("#{table_name}.term < ?", Time.zone.now.to_date) }
48
+ scope :today, -> { where(done: false).where("#{table_name}.term = ?", Time.zone.now.to_date) }
49
+ scope :tomorrow, -> { where(done: false).where("#{table_name}.term = ?", Date.tomorrow) }
50
50
 
51
51
  scope :this_week, -> {
52
52
  min = Date.tomorrow
53
53
  max = Time.zone.now.to_date.end_of_week
54
- where(done: false).where("term > ?", min).where("term <= ?", max)
54
+ where(done: false).where("#{table_name}.term > ?", min).where("#{table_name}.term <= ?", max)
55
55
  }
56
56
 
57
57
  scope :next_week, -> {
58
58
  min = Time.zone.now.to_date.end_of_week
59
59
  max = Time.zone.now.to_date.next_week.end_of_week
60
- where(done: false).where("term > ?", min).where("term <= ?", max)
60
+ where(done: false).where("#{table_name}.term > ?", min).where("#{table_name}.term <= ?", max)
61
61
  }
62
62
 
63
63
  scope :next_next_week, -> {
64
64
  min = Time.zone.now.to_date.next_week.end_of_week
65
65
  max = Time.zone.now.to_date.next_week.next_week.end_of_week
66
- where(done: false).where("term > ?", min).where("term <= ?", max)
66
+ where(done: false).where("#{table_name}.term > ?", min).where("#{table_name}.term <= ?", max)
67
67
  }
68
68
 
69
69
  validates :name, presence: true
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.7.5"
2
+ VERSION = "3.7.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorsale
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.5
4
+ version: 3.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée