arql 0.4.4 → 0.4.5

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: 14f47987d63ecc0665d5cce2b8b503ffeff2587f6235499138f6d6da22fc104c
4
- data.tar.gz: aa143c6f15dd4e2df5f79a992547548938ba59fd8126f9bfdfeaa2dcb83f0cef
3
+ metadata.gz: 354500851ea6169979e5d9b3e27abb9a45ed43d3945bf94ade6705603930f96c
4
+ data.tar.gz: b17a8353faa43df65c9f66441631836b4ee4136425dce7183a49119881a8f70b
5
5
  SHA512:
6
- metadata.gz: '0863699e29b5c7ec31db4359657e7c3d3010f2ca5636484c9f93a2e1826f06e6daf846aad678a5a59d8b0414eb9470058788143cdafc8187e653c43916d29b5a'
7
- data.tar.gz: fe913b85a782e139af4d1751d54fc9f33178eed8a202b593acb81f5db02c13af71e86e817f234285c6350970324000f42dc5422107fe8f2877bb8fedce235c22
6
+ metadata.gz: a8cd8292e60d3d68eed8ae877429ed87d88ebbb491f76de390d64b2566edaa82a34e0cb84ffae0ca433065c592f046649e476935d10b0daa803f25ca7aff5e0d
7
+ data.tar.gz: 554c2b9db30566fe243d114d329bc3ee2dcf97fbe3e7ee3a3b7570837ce8d717410e8e07dc38e3d3d1a3092abf0d1f2f91685475b89152cd02d6dd258fd58939
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.4.4)
4
+ arql (0.4.5)
5
5
  activerecord (>= 6.1.5, < 7.1.0)
6
6
  activesupport (>= 6.1.5, < 7.1.0)
7
7
  caxlsx (~> 3.3.0)
@@ -76,6 +76,16 @@ module Arql
76
76
  model[:comment] = @comments[table_name]
77
77
  @models << model
78
78
  end
79
+
80
+ order_column = @options[:order_column]
81
+ if order_column
82
+ Thread.new do
83
+ @models.each do |model|
84
+ model_class = model[:model]
85
+ model_class.implicit_order_column = order_column if model_class.column_names.include?(order_column)
86
+ end
87
+ end
88
+ end
79
89
  end
80
90
 
81
91
  def model_names_mapping
@@ -144,8 +154,6 @@ module Arql
144
154
  end
145
155
  self.table_name = table_name
146
156
  self.inheritance_column = nil
147
- order_column = options[:order_column]
148
- self.implicit_order_column = order_column if order_column
149
157
  ActiveRecord.default_timezone = :local
150
158
  if options[:created_at].present?
151
159
  define_singleton_method :timestamp_attributes_for_create do
data/lib/arql/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang