active_record_extended 1.2.0 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +85 -7
- data/lib/active_record_extended/active_record.rb +2 -11
- data/lib/active_record_extended/active_record/relation_patch.rb +21 -4
- data/lib/active_record_extended/arel.rb +1 -0
- data/lib/active_record_extended/arel/nodes.rb +24 -21
- data/lib/active_record_extended/arel/predications.rb +3 -2
- data/lib/active_record_extended/arel/sql_literal.rb +16 -0
- data/lib/active_record_extended/arel/visitors/postgresql_decorator.rb +1 -1
- data/lib/active_record_extended/query_methods/any_of.rb +5 -4
- data/lib/active_record_extended/query_methods/either.rb +2 -1
- data/lib/active_record_extended/query_methods/inet.rb +6 -2
- data/lib/active_record_extended/query_methods/json.rb +14 -17
- data/lib/active_record_extended/query_methods/select.rb +13 -12
- data/lib/active_record_extended/query_methods/unionize.rb +13 -7
- data/lib/active_record_extended/query_methods/where_chain.rb +17 -8
- data/lib/active_record_extended/query_methods/window.rb +93 -0
- data/lib/active_record_extended/query_methods/with_cte.rb +104 -37
- data/lib/active_record_extended/utilities/order_by.rb +11 -30
- data/lib/active_record_extended/utilities/support.rb +21 -18
- data/lib/active_record_extended/version.rb +1 -1
- data/spec/query_methods/any_of_spec.rb +2 -2
- data/spec/query_methods/either_spec.rb +11 -0
- data/spec/query_methods/json_spec.rb +5 -5
- data/spec/query_methods/select_spec.rb +13 -13
- data/spec/query_methods/unionize_spec.rb +5 -5
- data/spec/query_methods/window_spec.rb +51 -0
- data/spec/query_methods/with_cte_spec.rb +12 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/sql_inspections/any_of_sql_spec.rb +2 -2
- data/spec/sql_inspections/contains_sql_queries_spec.rb +8 -8
- data/spec/sql_inspections/either_sql_spec.rb +19 -3
- data/spec/sql_inspections/json_sql_spec.rb +7 -1
- data/spec/sql_inspections/unionize_sql_spec.rb +2 -2
- data/spec/sql_inspections/window_sql_spec.rb +98 -0
- data/spec/sql_inspections/with_cte_sql_spec.rb +30 -1
- data/spec/support/models.rb +18 -0
- metadata +23 -20
- data/lib/active_record_extended/patch/5_0/predicate_builder_decorator.rb +0 -87
- data/lib/active_record_extended/patch/5_0/regex_match.rb +0 -10
@@ -3,14 +3,14 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
RSpec.describe "Contains SQL Queries" do
|
6
|
-
let(:contains_array_regex) {
|
7
|
-
let(:contains_hstore_regex) {
|
8
|
-
let(:contains_jsonb_regex) {
|
9
|
-
let(:contained_in_array_regex) {
|
10
|
-
let(:contained_in_hstore_regex) {
|
11
|
-
let(:contained_in_jsonb_regex) {
|
12
|
-
let(:contains_equals_regex) {
|
13
|
-
let(:equality_regex) {
|
6
|
+
let(:contains_array_regex) { /"users"\."tag_ids" @> '\{1,2\}'/ }
|
7
|
+
let(:contains_hstore_regex) { /"users"\."data" @> '"nickname"=>"Dan"'/ }
|
8
|
+
let(:contains_jsonb_regex) { /"users"\."jsonb_data" @> '\{"nickname":"Dan"}'/ }
|
9
|
+
let(:contained_in_array_regex) { /"users"\."tag_ids" <@ '\{1,2\}'/ }
|
10
|
+
let(:contained_in_hstore_regex) { /"users"\."data" <@ '"nickname"=>"Dan"'/ }
|
11
|
+
let(:contained_in_jsonb_regex) { /"users"\."jsonb_data" <@ '\{"nickname":"Dan"}'/ }
|
12
|
+
let(:contains_equals_regex) { /"users"\."ip" >>= '127.0.0.1'/ }
|
13
|
+
let(:equality_regex) { /"users"\."tags" = '\{"?working"?\}'/ }
|
14
14
|
|
15
15
|
describe ".where.contains(:column => value)" do
|
16
16
|
it "generates the appropriate where clause for array columns" do
|
@@ -3,9 +3,9 @@
|
|
3
3
|
require "spec_helper"
|
4
4
|
|
5
5
|
RSpec.describe "Either Methods SQL Queries" do
|
6
|
-
let(:contains_array_regex) {
|
7
|
-
let(:profile_l_outer_join) { /LEFT OUTER JOIN
|
8
|
-
let(:profile_r_outer_join) { /LEFT OUTER JOIN
|
6
|
+
let(:contains_array_regex) { /"users"\."tag_ids" @> '\{1,2\}'/ }
|
7
|
+
let(:profile_l_outer_join) { /LEFT OUTER JOIN "profile_ls" ON "profile_ls"."user_id" = "users"."id"/ }
|
8
|
+
let(:profile_r_outer_join) { /LEFT OUTER JOIN "profile_rs" ON "profile_rs"."user_id" = "users"."id"/ }
|
9
9
|
let(:where_join_case) do
|
10
10
|
"WHERE ((CASE WHEN profile_ls.user_id IS NULL"\
|
11
11
|
" THEN profile_rs.user_id"\
|
@@ -31,6 +31,22 @@ RSpec.describe "Either Methods SQL Queries" do
|
|
31
31
|
query = User.either_join(:profile_l, :profile_r).to_sql
|
32
32
|
expect(query).to include(where_join_case)
|
33
33
|
end
|
34
|
+
|
35
|
+
context "Through association .either_joins/2" do
|
36
|
+
let!(:four) { User.create! }
|
37
|
+
let!(:group) { Group.create!(users: [four]) }
|
38
|
+
let(:where_join_through_case) do
|
39
|
+
"WHERE ((CASE WHEN profile_ls.user_id IS NULL"\
|
40
|
+
" THEN groups_users.user_id"\
|
41
|
+
" ELSE profile_ls.user_id END) "\
|
42
|
+
"= users.id)"
|
43
|
+
end
|
44
|
+
|
45
|
+
it "Should contain a case statement that will conditionally alternative between tables" do
|
46
|
+
query = User.either_join(:profile_l, :groups).to_sql
|
47
|
+
expect(query).to include(where_join_through_case)
|
48
|
+
end
|
49
|
+
end
|
34
50
|
end
|
35
51
|
|
36
52
|
describe ".either_order/2" do
|
@@ -27,7 +27,6 @@ RSpec.describe "JSON Methods SQL Queries" do
|
|
27
27
|
context "When adding cast_with: option" do
|
28
28
|
it "should wrap the row_to_json expression with to_jsonb" do
|
29
29
|
query = User.select_row_to_json(User.where(id: 10), cast_with: :to_jsonb, key: :convert_this, as: :results).to_sql
|
30
|
-
puts query
|
31
30
|
expect(query).to match_regex(/SELECT \(SELECT TO_JSONB\(ROW_TO_JSON\("convert_this"\)\) FROM \(.+\).+\) AS "results"/)
|
32
31
|
end
|
33
32
|
|
@@ -53,6 +52,13 @@ RSpec.describe "JSON Methods SQL Queries" do
|
|
53
52
|
end
|
54
53
|
end
|
55
54
|
end
|
55
|
+
|
56
|
+
context "when the subquery is a STI record type" do
|
57
|
+
it "should not append sti 'type IN(..)' where clauses to the nested query" do
|
58
|
+
query = User.select_row_to_json(AdminSti.where(id: 10), cast_with: :array, key: :convert_this, as: :results).to_sql
|
59
|
+
expect(query).to match_regex(/SELECT \(ARRAY\(SELECT ROW_TO_JSON\("convert_this"\) FROM \(.*\) convert_this\)\) AS .+/)
|
60
|
+
end
|
61
|
+
end
|
56
62
|
end
|
57
63
|
|
58
64
|
describe ".json_build_object" do
|
@@ -74,7 +74,7 @@ RSpec.describe "Union SQL Queries" do
|
|
74
74
|
|
75
75
|
it "should alias the union from clause to 'happy_users'" do
|
76
76
|
expect(described_method).to match_regex(/FROM \(+.+\) UNION \(.+\)+ happy_users$/)
|
77
|
-
expect(described_method).to match_regex(/^SELECT happy_users\.id FROM.+happy_users$/)
|
77
|
+
expect(described_method).to match_regex(/^SELECT (happy_users\.id|"happy_users"\."id") FROM.+happy_users$/)
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -83,7 +83,7 @@ RSpec.describe "Union SQL Queries" do
|
|
83
83
|
|
84
84
|
it "should retain the actual class calling table name as the union alias" do
|
85
85
|
expect(described_method).to match_regex(/FROM \(+.+\) UNION \(.+\)+ users$/)
|
86
|
-
expect(described_method).to match_regex(/^SELECT
|
86
|
+
expect(described_method).to match_regex(/^SELECT "users"\."id" FROM.+users$/)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "spec_helper"
|
4
|
+
|
5
|
+
RSpec.describe "Active Record WINDOW Query inspection" do
|
6
|
+
describe "#define_window" do
|
7
|
+
context "when there is a single defined window" do
|
8
|
+
it "should only contain a single defined window statement at the bottom" do
|
9
|
+
query = Tag.define_window(:w_test).partition_by(:user_id).to_sql
|
10
|
+
expect(query).to eq('SELECT "tags".* FROM "tags" WINDOW w_test AS (PARTITION BY user_id)')
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return a single defined window with a defined ORDER BY" do
|
14
|
+
query = Tag.define_window(:w_test).partition_by(:user_id, order_by: { tags: { user_id: :desc } }).to_sql
|
15
|
+
expect(query).to end_with("WINDOW w_test AS (PARTITION BY user_id ORDER BY tags.user_id DESC)")
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should place the window function below the WHERE and GROUP BY statements" do
|
19
|
+
query = Tag.define_window(:w_test).partition_by(:user_id).where(id: 1).group(:user_id).to_sql
|
20
|
+
expect(query).to eq('SELECT "tags".* FROM "tags" WHERE "tags"."id" = 1 GROUP BY "tags"."user_id" WINDOW w_test AS (PARTITION BY user_id)')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "when there are multiple defined windows" do
|
25
|
+
it "should only contain a single defined window statement at the bottom" do
|
26
|
+
query =
|
27
|
+
Tag
|
28
|
+
.define_window(:test).partition_by(:user_id)
|
29
|
+
.define_window(:other_window).partition_by(:id)
|
30
|
+
.to_sql
|
31
|
+
|
32
|
+
expect(query).to end_with("WINDOW test AS (PARTITION BY user_id), other_window AS (PARTITION BY id)")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should contain each windows order by statements" do
|
36
|
+
query =
|
37
|
+
Tag
|
38
|
+
.define_window(:test).partition_by(:user_id, order_by: :id)
|
39
|
+
.define_window(:other_window).partition_by(:id, order_by: { tags: :user_id })
|
40
|
+
.to_sql
|
41
|
+
|
42
|
+
expect(query).to end_with("WINDOW test AS (PARTITION BY user_id ORDER BY id), other_window AS (PARTITION BY id ORDER BY tags.user_id ASC)")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "#window_select" do
|
48
|
+
let(:query_base) { Tag.define_window(:w).partition_by(:user_id, order_by: :id) }
|
49
|
+
let(:expected_end) { "WINDOW w AS (PARTITION BY user_id ORDER BY id)" }
|
50
|
+
|
51
|
+
context "when using no argument window methods" do
|
52
|
+
[:row_to_number, :rank, :dense_rank, :percent_rank, :cume_dist].each do |window_function|
|
53
|
+
context "#{window_function.to_s.upcase}()" do
|
54
|
+
let(:expected_function) { "#{window_function.to_s.upcase}()" }
|
55
|
+
let(:query) do
|
56
|
+
query_base.select_window(window_function, over: :w, as: :window_response).to_sql
|
57
|
+
end
|
58
|
+
|
59
|
+
it "appends the function to the select query" do
|
60
|
+
expected_start = "SELECT (#{expected_function} OVER w) AS \"window_response\""
|
61
|
+
expect(query).to start_with(expected_start).and(end_with(expected_end))
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context "when using an argument based window method" do
|
68
|
+
let(:argument_list) { ["a", 1, :sauce] }
|
69
|
+
|
70
|
+
{ ntile: 1, lag: 2, lead: 3, first_value: 1, last_value: 1, nth_value: 2 }.each_pair do |window_function, arg_count|
|
71
|
+
context "#{window_function.to_s.upcase}/#{arg_count}" do
|
72
|
+
let(:arguments) { argument_list.first(arg_count) }
|
73
|
+
let(:expected_function) { "#{window_function.to_s.upcase}(#{arguments.join(', ')})" }
|
74
|
+
let(:query) do
|
75
|
+
query_base.select_window(window_function, *arguments, over: :w, as: :window_response).to_sql
|
76
|
+
end
|
77
|
+
|
78
|
+
it "appends the function to the select query" do
|
79
|
+
expected_start = "SELECT (#{expected_function} OVER w) AS \"window_response\""
|
80
|
+
expect(query).to start_with(expected_start).and(end_with(expected_end))
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
context "when not providing a partition by value" do
|
87
|
+
it "should construct a window function" do
|
88
|
+
query =
|
89
|
+
Tag
|
90
|
+
.define_window(:no_args).partition_by(order_by: { tag_number: :desc })
|
91
|
+
.select_window(:row_number, over: :no_args, as: :my_row)
|
92
|
+
.to_sql
|
93
|
+
|
94
|
+
expect(query).to eq("SELECT (ROW_NUMBER() OVER no_args) AS \"my_row\" FROM \"tags\" WINDOW no_args AS (ORDER BY tag_number DESC)")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -21,6 +21,20 @@ RSpec.describe "Active Record WITH CTE tables" do
|
|
21
21
|
expect(query).to match_regex(with_personal_query)
|
22
22
|
end
|
23
23
|
|
24
|
+
it "will pipe Children CTE's into the Parent relation" do
|
25
|
+
personal_id_one_query = User.where(personal_id: 1)
|
26
|
+
personal_id_two_query = User.where(personal_id: 2)
|
27
|
+
|
28
|
+
sub_query = personal_id_two_query.with(personal_id_one: personal_id_one_query)
|
29
|
+
query = User.all.with(personal_id_two: sub_query)
|
30
|
+
expected_order = User.with(
|
31
|
+
personal_id_one: personal_id_one_query,
|
32
|
+
personal_id_two: personal_id_two_query
|
33
|
+
)
|
34
|
+
|
35
|
+
expect(query.to_sql).to eq(expected_order.to_sql)
|
36
|
+
end
|
37
|
+
|
24
38
|
context "when multiple CTE's" do
|
25
39
|
let(:chained_with) do
|
26
40
|
User.with(personal_id_one: User.where(personal_id: 1))
|
@@ -36,6 +50,7 @@ RSpec.describe "Active Record WITH CTE tables" do
|
|
36
50
|
.joins("JOIN personal_id_two ON personal_id_two.id = users.id")
|
37
51
|
.to_sql
|
38
52
|
end
|
53
|
+
|
39
54
|
it "Should only contain a single WITH statement" do
|
40
55
|
expect(with_arguments.scan(/WITH/).count).to eq(1)
|
41
56
|
expect(with_arguments.scan(/AS/).count).to eq(2)
|
@@ -60,7 +75,21 @@ RSpec.describe "Active Record WITH CTE tables" do
|
|
60
75
|
end
|
61
76
|
|
62
77
|
it "generates an expression with recursive" do
|
63
|
-
|
78
|
+
query = User.with
|
79
|
+
.recursive(personal_id_one: User.where(personal_id: 1))
|
80
|
+
.joins("JOIN personal_id_one ON personal_id_one.id = users.id")
|
81
|
+
.to_sql
|
82
|
+
|
83
|
+
expect(query).to match_regex(with_recursive_personal_query)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "will maintain the CTE table when merging" do
|
87
|
+
sub_query = User.with.recursive(personal_id_one: User.where(personal_id: 1))
|
88
|
+
query = User.merge(sub_query)
|
89
|
+
.joins("JOIN personal_id_one ON personal_id_one.id = users.id")
|
90
|
+
.to_sql
|
91
|
+
|
92
|
+
expect(query).to match_regex(with_recursive_personal_query)
|
64
93
|
end
|
65
94
|
end
|
66
95
|
end
|
data/spec/support/models.rb
CHANGED
@@ -5,6 +5,8 @@ class ApplicationRecord < ActiveRecord::Base
|
|
5
5
|
end
|
6
6
|
|
7
7
|
class User < ApplicationRecord
|
8
|
+
has_many :groups_users, class_name: "GroupsUser"
|
9
|
+
has_many :groups, through: :groups_users, dependent: :destroy
|
8
10
|
has_many :hm_tags, class_name: "Tag"
|
9
11
|
has_one :profile_l, class_name: "ProfileL"
|
10
12
|
has_one :profile_r, class_name: "ProfileR"
|
@@ -20,6 +22,12 @@ class User < ApplicationRecord
|
|
20
22
|
#
|
21
23
|
end
|
22
24
|
|
25
|
+
class StiRecord < ApplicationRecord
|
26
|
+
# t.string "type"
|
27
|
+
end
|
28
|
+
|
29
|
+
class AdminSti < StiRecord; end
|
30
|
+
|
23
31
|
module Namespaced
|
24
32
|
def self.table_name_prefix
|
25
33
|
"namespaced_"
|
@@ -60,3 +68,13 @@ class VersionControl < ApplicationRecord
|
|
60
68
|
# t.jsonb :source, default: {}, null: false
|
61
69
|
#
|
62
70
|
end
|
71
|
+
|
72
|
+
class Group < ApplicationRecord
|
73
|
+
has_many :groups_users, class_name: "GroupsUser"
|
74
|
+
has_many :users, through: :groups_users, dependent: :destroy
|
75
|
+
end
|
76
|
+
|
77
|
+
class GroupsUser < ApplicationRecord
|
78
|
+
belongs_to :user
|
79
|
+
belongs_to :group
|
80
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_extended
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Protacio-Karaszi
|
8
8
|
- Dan McClain
|
9
9
|
- Olivier El Mekki
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-06-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -18,20 +18,20 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '5.
|
21
|
+
version: '5.1'
|
22
22
|
- - "<"
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: '6.
|
24
|
+
version: '6.2'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
28
|
requirements:
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: '5.
|
31
|
+
version: '5.1'
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '6.
|
34
|
+
version: '6.2'
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: ar_outer_joins
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,14 +52,14 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - "<"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '3.0'
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '3.0'
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: bundler
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,7 @@ dependencies:
|
|
69
69
|
version: '1.16'
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
72
|
+
version: '3.0'
|
73
73
|
type: :development
|
74
74
|
prerelease: false
|
75
75
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -79,7 +79,7 @@ dependencies:
|
|
79
79
|
version: '1.16'
|
80
80
|
- - "<"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '3.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: database_cleaner
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,14 +98,14 @@ dependencies:
|
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '10.0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '10.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
@@ -153,9 +153,8 @@ files:
|
|
153
153
|
- lib/active_record_extended/arel/aggregate_function_name.rb
|
154
154
|
- lib/active_record_extended/arel/nodes.rb
|
155
155
|
- lib/active_record_extended/arel/predications.rb
|
156
|
+
- lib/active_record_extended/arel/sql_literal.rb
|
156
157
|
- lib/active_record_extended/arel/visitors/postgresql_decorator.rb
|
157
|
-
- lib/active_record_extended/patch/5_0/predicate_builder_decorator.rb
|
158
|
-
- lib/active_record_extended/patch/5_0/regex_match.rb
|
159
158
|
- lib/active_record_extended/patch/5_1/where_clause.rb
|
160
159
|
- lib/active_record_extended/patch/5_2/where_clause.rb
|
161
160
|
- lib/active_record_extended/predicate_builder/array_handler_decorator.rb
|
@@ -166,6 +165,7 @@ files:
|
|
166
165
|
- lib/active_record_extended/query_methods/select.rb
|
167
166
|
- lib/active_record_extended/query_methods/unionize.rb
|
168
167
|
- lib/active_record_extended/query_methods/where_chain.rb
|
168
|
+
- lib/active_record_extended/query_methods/window.rb
|
169
169
|
- lib/active_record_extended/query_methods/with_cte.rb
|
170
170
|
- lib/active_record_extended/utilities/order_by.rb
|
171
171
|
- lib/active_record_extended/utilities/support.rb
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- spec/query_methods/json_spec.rb
|
180
180
|
- spec/query_methods/select_spec.rb
|
181
181
|
- spec/query_methods/unionize_spec.rb
|
182
|
+
- spec/query_methods/window_spec.rb
|
182
183
|
- spec/query_methods/with_cte_spec.rb
|
183
184
|
- spec/spec_helper.rb
|
184
185
|
- spec/sql_inspections/any_of_sql_spec.rb
|
@@ -189,6 +190,7 @@ files:
|
|
189
190
|
- spec/sql_inspections/either_sql_spec.rb
|
190
191
|
- spec/sql_inspections/json_sql_spec.rb
|
191
192
|
- spec/sql_inspections/unionize_sql_spec.rb
|
193
|
+
- spec/sql_inspections/window_sql_spec.rb
|
192
194
|
- spec/sql_inspections/with_cte_sql_spec.rb
|
193
195
|
- spec/support/database_cleaner.rb
|
194
196
|
- spec/support/models.rb
|
@@ -196,7 +198,7 @@ homepage: https://github.com/georgekaraszi/ActiveRecordExtended
|
|
196
198
|
licenses:
|
197
199
|
- MIT
|
198
200
|
metadata: {}
|
199
|
-
post_install_message:
|
201
|
+
post_install_message:
|
200
202
|
rdoc_options: []
|
201
203
|
require_paths:
|
202
204
|
- lib
|
@@ -204,16 +206,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
204
206
|
requirements:
|
205
207
|
- - ">="
|
206
208
|
- !ruby/object:Gem::Version
|
207
|
-
version: '
|
209
|
+
version: '2.4'
|
208
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
211
|
requirements:
|
210
212
|
- - ">="
|
211
213
|
- !ruby/object:Gem::Version
|
212
214
|
version: '0'
|
213
215
|
requirements: []
|
214
|
-
|
215
|
-
|
216
|
-
signing_key:
|
216
|
+
rubygems_version: 3.0.6
|
217
|
+
signing_key:
|
217
218
|
specification_version: 4
|
218
219
|
summary: Adds extended functionality to Activerecord Postgres implementation
|
219
220
|
test_files:
|
@@ -226,6 +227,7 @@ test_files:
|
|
226
227
|
- spec/query_methods/json_spec.rb
|
227
228
|
- spec/query_methods/select_spec.rb
|
228
229
|
- spec/query_methods/unionize_spec.rb
|
230
|
+
- spec/query_methods/window_spec.rb
|
229
231
|
- spec/query_methods/with_cte_spec.rb
|
230
232
|
- spec/spec_helper.rb
|
231
233
|
- spec/sql_inspections/any_of_sql_spec.rb
|
@@ -236,6 +238,7 @@ test_files:
|
|
236
238
|
- spec/sql_inspections/either_sql_spec.rb
|
237
239
|
- spec/sql_inspections/json_sql_spec.rb
|
238
240
|
- spec/sql_inspections/unionize_sql_spec.rb
|
241
|
+
- spec/sql_inspections/window_sql_spec.rb
|
239
242
|
- spec/sql_inspections/with_cte_sql_spec.rb
|
240
243
|
- spec/support/database_cleaner.rb
|
241
244
|
- spec/support/models.rb
|