arel_extensions 2.0.4 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +54 -86
- data/README.md +1 -1
- data/Rakefile +13 -2
- data/arel_extensions.gemspec +1 -1
- data/gemfiles/rails4.gemfile +1 -1
- data/gemfiles/rails6.gemfile +1 -1
- data/generate_gems.sh +4 -3
- data/lib/arel_extensions.rb +33 -19
- data/lib/arel_extensions/attributes.rb +0 -1
- data/lib/arel_extensions/boolean_functions.rb +39 -12
- data/lib/arel_extensions/insert_manager.rb +7 -5
- data/lib/arel_extensions/nodes/abs.rb +0 -0
- data/lib/arel_extensions/nodes/case.rb +1 -1
- data/lib/arel_extensions/nodes/ceil.rb +0 -0
- data/lib/arel_extensions/nodes/coalesce.rb +0 -0
- data/lib/arel_extensions/nodes/concat.rb +0 -0
- data/lib/arel_extensions/nodes/duration.rb +0 -0
- data/lib/arel_extensions/nodes/find_in_set.rb +0 -0
- data/lib/arel_extensions/nodes/floor.rb +0 -0
- data/lib/arel_extensions/nodes/function.rb +0 -0
- data/lib/arel_extensions/nodes/is_null.rb +0 -0
- data/lib/arel_extensions/nodes/length.rb +0 -0
- data/lib/arel_extensions/nodes/locate.rb +0 -0
- data/lib/arel_extensions/nodes/rand.rb +0 -0
- data/lib/arel_extensions/nodes/replace.rb +0 -0
- data/lib/arel_extensions/nodes/round.rb +0 -0
- data/lib/arel_extensions/nodes/soundex.rb +0 -0
- data/lib/arel_extensions/nodes/substring.rb +0 -0
- data/lib/arel_extensions/nodes/trim.rb +0 -0
- data/lib/arel_extensions/nodes/union.rb +0 -0
- data/lib/arel_extensions/nodes/wday.rb +0 -0
- data/lib/arel_extensions/predications.rb +22 -19
- data/lib/arel_extensions/set_functions.rb +2 -2
- data/lib/arel_extensions/string_functions.rb +13 -0
- data/lib/arel_extensions/version.rb +1 -1
- data/lib/arel_extensions/visitors.rb +1 -1
- data/lib/arel_extensions/visitors/ibm_db.rb +1 -1
- data/lib/arel_extensions/visitors/mysql.rb +24 -9
- data/lib/arel_extensions/visitors/oracle.rb +7 -8
- data/lib/arel_extensions/visitors/postgresql.rb +1 -1
- data/lib/arel_extensions/visitors/sqlite.rb +11 -7
- data/lib/arel_extensions/visitors/to_sql.rb +31 -38
- data/test/arelx_test_helper.rb +28 -0
- data/test/support/fake_record.rb +4 -0
- data/test/test_comparators.rb +8 -7
- data/test/visitors/test_bulk_insert_oracle.rb +4 -3
- data/test/visitors/test_bulk_insert_sqlite.rb +4 -3
- data/test/visitors/test_bulk_insert_to_sql.rb +3 -3
- data/test/visitors/test_oracle.rb +41 -41
- data/test/visitors/test_to_sql.rb +359 -206
- data/test/with_ar/all_agnostic_test.rb +18 -8
- data/test/with_ar/insert_agnostic_test.rb +1 -1
- data/test/with_ar/test_bulk_sqlite.rb +4 -3
- data/test/with_ar/test_math_sqlite.rb +1 -1
- data/test/with_ar/test_string_mysql.rb +1 -1
- data/test/with_ar/test_string_sqlite.rb +1 -1
- data/version_v1.rb +1 -1
- data/version_v2.rb +1 -1
- metadata +3 -3
- data/test/helper.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5080e8422006270a6c69337931908b043c1c494679d453a8ea89328390e84174
|
4
|
+
data.tar.gz: 9189ce88f62c39a385dc5b5fa55a021d8c7c2967d7025eb4710d1403ac9dc078
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f477cee1a8ce18be9346c1b10fc10b90e0cf28921f2dc518a67e49aba8dba771b73a0c2d822b2fd6336b4596c0684526f044b0d02d0b4c77792c765174d7d350
|
7
|
+
data.tar.gz: 45da36b498e8c905e2d6793234fa2a094947e450a9a58e52d272ade8d63f474008d2bfc2ec674305224bc8650a9e55d3446211fb5f0258ad7a2bcada2a38e991
|
data/.travis.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
language: ruby
|
2
2
|
sudo: required
|
3
|
+
dist: trusty
|
3
4
|
cache:
|
4
5
|
bundler: true
|
5
6
|
directories:
|
@@ -15,21 +16,23 @@ before_install:
|
|
15
16
|
# - sh -ex .travis/oracle/install.sh
|
16
17
|
# - .travis/setup_accounts.sh
|
17
18
|
install:
|
18
|
-
- gem install bundler -v 1.17.3
|
19
19
|
- bundle install
|
20
20
|
gemfile:
|
21
21
|
- gemfiles/rails4.gemfile
|
22
22
|
- gemfiles/rails5_0.gemfile
|
23
23
|
- gemfiles/rails5_1_4.gemfile
|
24
24
|
- gemfiles/rails5_2.gemfile
|
25
|
+
- gemfiles/rails6.gemfile
|
25
26
|
services:
|
26
27
|
- mysql
|
27
28
|
- postgresql
|
29
|
+
addons:
|
30
|
+
postgresql: '9.4'
|
28
31
|
before_script:
|
29
32
|
- mysql -e 'create database arext_test;'
|
30
33
|
- psql -c 'create database arext_test;' -U postgres
|
31
34
|
script:
|
32
|
-
-
|
35
|
+
- ./generate_gems.sh
|
33
36
|
- bundle exec rake test
|
34
37
|
- bundle exec rake test:sqlite
|
35
38
|
- bundle exec rake test:mysql
|
@@ -55,72 +58,33 @@ rvm:
|
|
55
58
|
- 2.3.1
|
56
59
|
- 2.4.0
|
57
60
|
- 2.5.0
|
58
|
-
-
|
61
|
+
- 2.7.1
|
59
62
|
- jruby-9.0.5.0
|
60
|
-
- jruby-9.2.
|
63
|
+
- jruby-9.2.11.1
|
61
64
|
- jruby-head
|
62
|
-
- ruby-head
|
63
65
|
jdk:
|
64
|
-
- openjdk7
|
65
66
|
- oraclejdk8
|
66
67
|
- oraclejdk9
|
67
68
|
- openjdk10
|
68
|
-
- oraclejdk10
|
69
69
|
- openjdk11
|
70
70
|
- oraclejdk11
|
71
71
|
matrix:
|
72
72
|
fast_finish: true
|
73
73
|
exclude:
|
74
|
-
- rvm: rbx-2
|
75
|
-
jdk: openjdk7
|
76
74
|
- rvm: 2.0.0
|
77
|
-
jdk:
|
78
|
-
- rvm: 2.1
|
79
|
-
jdk: openjdk7
|
80
|
-
- rvm: 2.2.5
|
81
|
-
jdk: openjdk7
|
82
|
-
- rvm: 2.3.1
|
83
|
-
jdk: openjdk7
|
84
|
-
- rvm: 2.4.0
|
85
|
-
jdk: openjdk7
|
86
|
-
- rvm: 2.5.0
|
87
|
-
jdk: openjdk7
|
88
|
-
- rvm: ruby-head
|
89
|
-
jdk: openjdk7
|
90
|
-
- rvm: rbx-2
|
91
|
-
jdk: oraclejdk8
|
92
|
-
- rvm: 2.0.0
|
93
|
-
jdk: oraclejdk8
|
94
|
-
- rvm: 2.1
|
95
|
-
jdk: oraclejdk8
|
96
|
-
- rvm: 2.2.5
|
97
|
-
jdk: oraclejdk8
|
98
|
-
- rvm: 2.3.1
|
99
|
-
jdk: oraclejdk8
|
100
|
-
- rvm: 2.4.0
|
101
|
-
jdk: oraclejdk8
|
102
|
-
- rvm: 2.5.0
|
103
|
-
jdk: oraclejdk8
|
104
|
-
- rvm: ruby-head
|
105
|
-
jdk: oraclejdk8
|
106
|
-
- rvm: rbx-2
|
107
|
-
jdk: oraclejdk10
|
108
|
-
- rvm: 2.0.0
|
109
|
-
jdk: oraclejdk10
|
75
|
+
jdk: oraclejdk9
|
110
76
|
- rvm: 2.1
|
111
|
-
jdk:
|
77
|
+
jdk: oraclejdk9
|
112
78
|
- rvm: 2.2.5
|
113
|
-
jdk:
|
79
|
+
jdk: oraclejdk9
|
114
80
|
- rvm: 2.3.1
|
115
|
-
jdk:
|
81
|
+
jdk: oraclejdk9
|
116
82
|
- rvm: 2.4.0
|
117
|
-
jdk:
|
83
|
+
jdk: oraclejdk9
|
118
84
|
- rvm: 2.5.0
|
119
|
-
jdk:
|
120
|
-
- rvm:
|
121
|
-
jdk:
|
122
|
-
- rvm: rbx-2
|
123
|
-
jdk: openjdk10
|
85
|
+
jdk: oraclejdk9
|
86
|
+
- rvm: 2.7.1
|
87
|
+
jdk: oraclejdk9
|
124
88
|
- rvm: 2.0.0
|
125
89
|
jdk: openjdk10
|
126
90
|
- rvm: 2.1
|
@@ -133,10 +97,8 @@ matrix:
|
|
133
97
|
jdk: openjdk10
|
134
98
|
- rvm: 2.5.0
|
135
99
|
jdk: openjdk10
|
136
|
-
- rvm:
|
100
|
+
- rvm: 2.7.1
|
137
101
|
jdk: openjdk10
|
138
|
-
- rvm: rbx-2
|
139
|
-
jdk: oraclejdk11
|
140
102
|
- rvm: 2.0.0
|
141
103
|
jdk: oraclejdk11
|
142
104
|
- rvm: 2.1
|
@@ -149,10 +111,8 @@ matrix:
|
|
149
111
|
jdk: oraclejdk11
|
150
112
|
- rvm: 2.5.0
|
151
113
|
jdk: oraclejdk11
|
152
|
-
- rvm:
|
114
|
+
- rvm: 2.7.1
|
153
115
|
jdk: oraclejdk11
|
154
|
-
- rvm: rbx-2
|
155
|
-
jdk: openjdk11
|
156
116
|
- rvm: 2.0.0
|
157
117
|
jdk: openjdk11
|
158
118
|
- rvm: 2.1
|
@@ -165,59 +125,67 @@ matrix:
|
|
165
125
|
jdk: openjdk11
|
166
126
|
- rvm: 2.5.0
|
167
127
|
jdk: openjdk11
|
168
|
-
- rvm:
|
128
|
+
- rvm: 2.7.1
|
169
129
|
jdk: openjdk11
|
170
|
-
- rvm:
|
171
|
-
|
172
|
-
- rvm: jruby-
|
173
|
-
jdk: openjdk7
|
174
|
-
- rvm: 2.0.0
|
175
|
-
gemfile: gemfiles/rails5_1_4.gemfile
|
176
|
-
- rvm: 2.1
|
177
|
-
gemfile: gemfiles/rails5_1_4.gemfile
|
178
|
-
- rvm: 2.2.5
|
179
|
-
gemfile: gemfiles/rails5_1_4.gemfile
|
180
|
-
- rvm: ruby-head
|
130
|
+
- rvm: 2.7.1
|
131
|
+
gemfile: gemfiles/rails4.gemfile
|
132
|
+
- rvm : jruby-9.2.11.1
|
181
133
|
gemfile: gemfiles/rails4.gemfile
|
182
134
|
- rvm: 2.0.0
|
183
135
|
gemfile: gemfiles/rails5_0.gemfile
|
184
136
|
- rvm: 2.1
|
185
137
|
gemfile: gemfiles/rails5_0.gemfile
|
186
|
-
- rvm:
|
138
|
+
- rvm: 2.7.1
|
139
|
+
gemfile: gemfiles/rails5.0.gemfile
|
140
|
+
- rvm: 2.0.0
|
141
|
+
gemfile: gemfiles/rails5_1_4.gemfile
|
142
|
+
- rvm: 2.1
|
143
|
+
gemfile: gemfiles/rails5_1_4.gemfile
|
144
|
+
- rvm: 2.2.5
|
187
145
|
gemfile: gemfiles/rails5_1_4.gemfile
|
146
|
+
- rvm: 2.7.1
|
147
|
+
gemfile: gemfiles/rails5.1.4.gemfile
|
148
|
+
- rvm: 2.7.1
|
149
|
+
gemfile: gemfiles/rails5.1.4.gemfile
|
188
150
|
- rvm: 2.0.0
|
189
151
|
gemfile: gemfiles/rails5_2.gemfile
|
190
152
|
- rvm: 2.1
|
191
153
|
gemfile: gemfiles/rails5_2.gemfile
|
192
|
-
|
193
|
-
- rvm: rbx-2
|
194
|
-
gemfile: gemfiles/rails4.gemfile
|
195
|
-
- rvm: rbx-2
|
196
|
-
gemfile: gemfiles/rails5_0.gemfile
|
197
|
-
- rvm: rbx-2
|
198
|
-
gemfile: gemfiles/rails5_1_4.gemfile
|
199
|
-
- rvm: rbx-2
|
154
|
+
- rvm: 2.2.5
|
200
155
|
gemfile: gemfiles/rails5_2.gemfile
|
201
|
-
- rvm:
|
156
|
+
- rvm: 2.7.1
|
157
|
+
gemfile: gemfiles/rails5.2.gemfile
|
158
|
+
- rvm: 2.0.0
|
159
|
+
gemfile: gemfiles/rails6.gemfile
|
160
|
+
- rvm: 2.1
|
161
|
+
gemfile: gemfiles/rails6.gemfile
|
162
|
+
- rvm: 2.2.5
|
163
|
+
gemfile: gemfiles/rails6.gemfile
|
164
|
+
- rvm: 2.3.1
|
165
|
+
gemfile: gemfiles/rails6.gemfile
|
166
|
+
- rvm: 2.4.0
|
167
|
+
gemfile: gemfiles/rails6.gemfile
|
168
|
+
allow_failures:
|
169
|
+
- rvm: jruby-9.0.5.0
|
202
170
|
gemfile: gemfiles/rails5_1_4.gemfile
|
203
171
|
- rvm: jruby-9.0.5.0
|
204
172
|
gemfile: gemfiles/rails5_2.gemfile
|
205
|
-
- rvm: jruby-9.2.
|
173
|
+
- rvm: jruby-9.2.11.1
|
206
174
|
jdk: oraclejdk9
|
207
175
|
gemfile: gemfiles/rails5_2.gemfile
|
176
|
+
- jdk: oraclejdk9
|
208
177
|
- jdk: openjdk10
|
209
|
-
- jdk: oraclejdk10
|
210
178
|
- jdk: openjdk11
|
211
179
|
- jdk: oraclejdk11
|
212
|
-
- rvm: ruby-head
|
213
180
|
- rvm: jruby-head
|
214
|
-
- rvm: jruby-9.2.
|
181
|
+
- rvm: jruby-9.2.11.1
|
215
182
|
jdk: oraclejdk9
|
216
183
|
- rvm: jruby-9.0.5.0
|
217
184
|
jdk: oraclejdk9
|
185
|
+
- rvm: 2.7.1
|
186
|
+
- gemfile: gemfiles/rails6.gemfile
|
218
187
|
bundler_args: "--jobs 3 --retry 2"
|
219
188
|
notifications:
|
220
189
|
email:
|
221
|
-
|
222
|
-
|
223
|
-
- yann.azoury@faveod.com
|
190
|
+
- julien.delporte@faveod.com
|
191
|
+
- yann.azoury@faveod.com
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -14,13 +14,24 @@ Rake::TestTask.new(:test) do |t|
|
|
14
14
|
t.verbose = true
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
namespace :test do
|
18
|
+
Rake::TestTask.new('to_sql' => []) { |t|
|
19
|
+
t.libs << 'lib'
|
20
|
+
t.libs << 'test'
|
21
|
+
t.pattern = 'test/visitors/test_to_sql.rb'
|
22
|
+
t.warning = true
|
23
|
+
t.verbose = true
|
24
|
+
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
%w[mysql postgresql sqlite ibm_db oracle mssql].each do |adapter|
|
18
29
|
namespace :test do
|
19
30
|
Rake::TestTask.new(adapter => "#{adapter}:env") { |t|
|
20
31
|
t.libs << 'lib'
|
21
32
|
t.libs << 'test'
|
22
33
|
t.pattern = 'test/with_ar/*_agnostic_test.rb'
|
23
|
-
t.warning =
|
34
|
+
t.warning = false
|
24
35
|
t.verbose = true
|
25
36
|
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
|
26
37
|
}
|
data/arel_extensions.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
|
-
s.add_dependency('
|
23
|
+
s.add_dependency('activerecord', '>= 6.0')
|
24
24
|
|
25
25
|
s.add_development_dependency('minitest', '~> 5.9')
|
26
26
|
s.add_development_dependency('rdoc', '~> 4.0')
|
data/gemfiles/rails4.gemfile
CHANGED
@@ -18,7 +18,7 @@ group :development, :test do
|
|
18
18
|
gem 'activerecord-oracle_enhanced-adapter', '~> 1.6.0' if ENV.has_key? 'ORACLE_HOME'
|
19
19
|
|
20
20
|
# for JRuby
|
21
|
-
gem 'activerecord-jdbc-adapter',
|
21
|
+
gem 'activerecord-jdbc-adapter', '~> 1.3' ,:platforms => :jruby
|
22
22
|
gem "jdbc-sqlite3", :platforms => :jruby
|
23
23
|
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
24
24
|
gem "activerecord-jdbcmysql-adapter", :platforms => :jruby
|
data/gemfiles/rails6.gemfile
CHANGED
data/generate_gems.sh
CHANGED
@@ -7,7 +7,8 @@ gem build ./arel_extensions.gemspec
|
|
7
7
|
|
8
8
|
# VERSION ~> 2
|
9
9
|
cp ./version_v2.rb lib/arel_extensions/version.rb
|
10
|
-
|
11
|
-
|
10
|
+
mv ./arel_extensions.gemspec ./arel_extensions.gemspec.bck
|
11
|
+
cp ./gemspec_v2/arel_extensions-v2.gemspec ./arel_extensions.gemspec
|
12
|
+
gem build ./arel_extensions.gemspec
|
12
13
|
cp ./version_v1.rb lib/arel_extensions/version.rb
|
13
|
-
|
14
|
+
cp ./arel_extensions.gemspec.bck ./arel_extensions.gemspec
|
data/lib/arel_extensions.rb
CHANGED
@@ -7,35 +7,37 @@ require 'arel_extensions/railtie' if defined?(Rails::Railtie)
|
|
7
7
|
# Count|NamedFunction < Function < Arel::Nodes::Node
|
8
8
|
|
9
9
|
# pure Arel internals improvements
|
10
|
-
Arel::Nodes::Binary
|
10
|
+
class Arel::Nodes::Binary
|
11
11
|
include Arel::AliasPredication
|
12
12
|
include Arel::Expressions
|
13
13
|
end
|
14
14
|
|
15
|
-
Arel::Nodes::Casted
|
15
|
+
class Arel::Nodes::Casted
|
16
16
|
include Arel::AliasPredication
|
17
|
+
|
18
|
+
# They forget to define hash.
|
19
|
+
def hash
|
20
|
+
[self.class, self.val, self.attribute].hash
|
21
|
+
end
|
17
22
|
end
|
18
23
|
|
19
|
-
Arel::Nodes::Unary
|
24
|
+
class Arel::Nodes::Unary
|
20
25
|
include Arel::Math
|
21
26
|
include Arel::AliasPredication
|
22
27
|
include Arel::Expressions
|
23
28
|
end
|
24
29
|
|
25
|
-
Arel::Nodes::Grouping
|
26
|
-
include Arel::Math
|
27
|
-
include Arel::AliasPredication
|
30
|
+
class Arel::Nodes::Grouping
|
28
31
|
include Arel::OrderPredications
|
29
|
-
include Arel::Expressions
|
30
32
|
end
|
31
33
|
|
32
|
-
Arel::Nodes::Function
|
34
|
+
class Arel::Nodes::Function
|
33
35
|
include Arel::Math
|
34
36
|
include Arel::Expressions
|
35
37
|
end
|
36
38
|
|
37
39
|
if Arel::VERSION >= "7.1.0"
|
38
|
-
Arel::Nodes::Case
|
40
|
+
class Arel::Nodes::Case
|
39
41
|
include Arel::Math
|
40
42
|
include Arel::Expressions
|
41
43
|
end
|
@@ -101,14 +103,18 @@ module Arel
|
|
101
103
|
Arel::Nodes::Equality.new(1,0)
|
102
104
|
end
|
103
105
|
|
106
|
+
def self.tuple *v
|
107
|
+
tmp = Arel::Nodes::Grouping.new(nil)
|
108
|
+
Arel::Nodes::Grouping.new(v.map{|e| tmp.convert_to_node(e)})
|
109
|
+
end
|
104
110
|
end
|
105
111
|
|
106
|
-
Arel::Attributes::Attribute
|
112
|
+
class Arel::Attributes::Attribute
|
107
113
|
include Arel::Math
|
108
114
|
include ArelExtensions::Attributes
|
109
115
|
end
|
110
116
|
|
111
|
-
Arel::Nodes::Function
|
117
|
+
class Arel::Nodes::Function
|
112
118
|
include ArelExtensions::Math
|
113
119
|
include ArelExtensions::Comparators
|
114
120
|
include ArelExtensions::DateDuration
|
@@ -122,10 +128,19 @@ Arel::Nodes::Function.class_eval do
|
|
122
128
|
def as other
|
123
129
|
Arel::Nodes::As.new(self, Arel.sql(other))
|
124
130
|
end
|
131
|
+
end
|
125
132
|
|
133
|
+
class Arel::Nodes::Grouping
|
134
|
+
include ArelExtensions::Math
|
135
|
+
include ArelExtensions::Comparators
|
136
|
+
include ArelExtensions::DateDuration
|
137
|
+
include ArelExtensions::MathFunctions
|
138
|
+
include ArelExtensions::NullFunctions
|
139
|
+
include ArelExtensions::StringFunctions
|
140
|
+
include ArelExtensions::Predications
|
126
141
|
end
|
127
142
|
|
128
|
-
Arel::Nodes::Unary
|
143
|
+
class Arel::Nodes::Unary
|
129
144
|
include ArelExtensions::Math
|
130
145
|
include ArelExtensions::Attributes
|
131
146
|
include ArelExtensions::MathFunctions
|
@@ -133,7 +148,7 @@ Arel::Nodes::Unary.class_eval do
|
|
133
148
|
include ArelExtensions::Predications
|
134
149
|
end
|
135
150
|
|
136
|
-
Arel::Nodes::Binary
|
151
|
+
class Arel::Nodes::Binary
|
137
152
|
include ArelExtensions::Math
|
138
153
|
include ArelExtensions::Attributes
|
139
154
|
include ArelExtensions::MathFunctions
|
@@ -142,28 +157,27 @@ Arel::Nodes::Binary.class_eval do
|
|
142
157
|
include ArelExtensions::Predications
|
143
158
|
end
|
144
159
|
|
145
|
-
Arel::Nodes::Equality
|
160
|
+
class Arel::Nodes::Equality
|
146
161
|
include ArelExtensions::Comparators
|
147
162
|
include ArelExtensions::DateDuration
|
148
163
|
include ArelExtensions::MathFunctions
|
149
164
|
include ArelExtensions::StringFunctions
|
150
165
|
end
|
151
166
|
|
152
|
-
|
153
|
-
Arel::InsertManager.class_eval do
|
167
|
+
class Arel::InsertManager
|
154
168
|
include ArelExtensions::InsertManager
|
155
169
|
end
|
156
170
|
|
157
|
-
Arel::SelectManager
|
171
|
+
class Arel::SelectManager
|
158
172
|
include ArelExtensions::SetFunctions
|
159
173
|
include ArelExtensions::Nodes
|
160
174
|
end
|
161
175
|
|
162
|
-
Arel::Nodes::As
|
176
|
+
class Arel::Nodes::As
|
163
177
|
include ArelExtensions::Nodes
|
164
178
|
end
|
165
179
|
|
166
|
-
Arel::Table
|
180
|
+
class Arel::Table
|
167
181
|
alias_method :old_alias, :alias
|
168
182
|
def alias(name = "#{self.name}_2")
|
169
183
|
name.blank? ? self : Arel::Nodes::TableAlias.new(self,name)
|