dorsale 3.12.0 → 3.13.0

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
  SHA256:
3
- metadata.gz: 2929616b8560e74343ed527fd6ede62bc2ee0bfa66e7629390ef8c0963bfd27f
4
- data.tar.gz: b3d12ad8b3c19316706583baebe2790b8f26e94e263806781fe6622beb1947fc
3
+ metadata.gz: 6523b32ed6ded0a2c2973f262d1c4c653e5686b4e46092598b28f7361ac59490
4
+ data.tar.gz: 2041d1694e962515f16ba41179fa7feb7059f4afae4c68064cecb0a24c85f9fc
5
5
  SHA512:
6
- metadata.gz: 3817c01b04ff4a47bb5a87f0a9073314a4a1ceae7c55018ddddeb1ed1c692e8d4ab647f1931876bf657d20355557174a2cec19aaa9d99f6a1fd0c6ee2990a888
7
- data.tar.gz: 8621383721811a53a903e7c214163ef12ae2919fbec6c05304b1e0af5a1d0a7ddd4d32f9b0c36b5fe922f66ef3c48ed83e500e8e5db76c351ca4fcf6b6bfd9f0
6
+ metadata.gz: c87828175a390e626c9d924b5f03f08ffd2c7499c15325469200674c632d5b2f5a12c53f54aef24007418b08e27ce8f9cd167bdd92314baa751d6342b32e46cd
7
+ data.tar.gz: '09140a1d504656c7c02086c420ed0a1805a4f52f9b3176f7cbb48c141ac71121df2eb785f4e398e0b1e0294b45cddf9f6f9bc9c4eacfd96efe1370dfd9cdd7f1'
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 3.13.0
6
+ - Rails 5.2 compatible
7
+
5
8
  ## 3.12.0
6
9
  - Change attachment observers
7
10
 
@@ -5,10 +5,7 @@ class Dorsale::ApplicationRecord < ActiveRecord::Base
5
5
  include Agilibox::ModelToS
6
6
  include Agilibox::ModelI18n
7
7
  include Agilibox::PolymorphicId
8
+ include Agilibox::TimestampHelpers
8
9
 
9
10
  nilify_blanks before: :validation
10
-
11
- def self.last_created
12
- reorder(:created_at, :id).last
13
- end
14
11
  end
@@ -37,13 +37,15 @@ class Dorsale::CustomerVault::Person < ::Dorsale::ApplicationRecord
37
37
  }
38
38
 
39
39
  scope :order_by_name, -> {
40
- order %(
40
+ sql = %(
41
41
  LOWER(
42
42
  COALESCE(corporation_name, '') ||
43
43
  COALESCE(last_name, '') ||
44
44
  COALESCE(first_name, '')
45
45
  ) ASC
46
46
  )
47
+
48
+ order(Arel.sql sql)
47
49
  }
48
50
 
49
51
  scope :having_email, -> (email) { where("email = :e OR :e = ANY (secondary_emails)", e: email) }
@@ -4,11 +4,11 @@ class Dorsale::Alexandrie::AttachmentsSorter < Agilibox::Sorter
4
4
  when :created_at, :updated_at
5
5
  {column => direction}
6
6
  when :name
7
- %(LOWER(#{model.table_name}.#{column}) #{direction})
7
+ Arel.sql %(LOWER(#{model.table_name}.#{column}) #{direction})
8
8
  when :attachment_type_name
9
9
  @collection = @collection.joins(:attachment_type)
10
10
  table = Dorsale::Alexandrie::AttachmentType.table_name
11
- %(LOWER(#{table}.name) #{direction})
11
+ Arel.sql %(LOWER(#{table}.name) #{direction})
12
12
  else
13
13
  {created_at: :desc, id: :desc}
14
14
  end
@@ -1,10 +1,10 @@
1
1
  class Dorsale::Flyboy::TasksSorter < Agilibox::Sorter
2
2
  def sort
3
3
  case column
4
- when :name, :status
5
- %(LOWER(dorsale_flyboy_tasks.#{column}) #{direction})
6
- when :progress, :term
7
- %(dorsale_flyboy_tasks.#{column} #{direction})
4
+ when :name
5
+ Arel.sql %(LOWER(dorsale_flyboy_tasks.#{column}) #{direction})
6
+ when :progress, :term, :status
7
+ {column => direction}
8
8
  when :taskable
9
9
  if direction == :asc
10
10
  proc { |a, b| a.taskable.to_s.downcase <=> b.taskable.to_s.downcase }
@@ -12,7 +12,7 @@ class Dorsale::Flyboy::TasksSorter < Agilibox::Sorter
12
12
  proc { |a, b| b.taskable.to_s.downcase <=> a.taskable.to_s.downcase }
13
13
  end
14
14
  when :tags
15
- %(
15
+ Arel.sql %(
16
16
  (
17
17
  SELECT STRING_AGG(n, ' ' ORDER BY n)
18
18
  FROM (
@@ -1,3 +1,3 @@
1
1
  module Dorsale
2
- VERSION = "3.12.0"
2
+ VERSION = "3.13.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorsale
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.0
4
+ version: 3.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2019-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.6
33
+ version: 1.0.10
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.6
40
+ version: 1.0.10
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: virtus
43
43
  requirement: !ruby/object:Gem::Requirement