rom-sql 0.9.1 → 1.0.0.beta1

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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +32 -0
  4. data/Gemfile +4 -1
  5. data/lib/rom/plugins/relation/sql/auto_wrap.rb +1 -3
  6. data/lib/rom/sql/association.rb +33 -14
  7. data/lib/rom/sql/association/many_to_many.rb +17 -10
  8. data/lib/rom/sql/association/many_to_one.rb +29 -13
  9. data/lib/rom/sql/association/name.rb +12 -4
  10. data/lib/rom/sql/association/one_to_many.rb +21 -10
  11. data/lib/rom/sql/commands/create.rb +0 -1
  12. data/lib/rom/sql/commands/update.rb +1 -49
  13. data/lib/rom/sql/dsl.rb +29 -0
  14. data/lib/rom/sql/expression.rb +26 -0
  15. data/lib/rom/sql/function.rb +23 -0
  16. data/lib/rom/sql/gateway.rb +24 -9
  17. data/lib/rom/sql/migration.rb +6 -7
  18. data/lib/rom/sql/migration/migrator.rb +7 -8
  19. data/lib/rom/sql/order_dsl.rb +20 -0
  20. data/lib/rom/sql/plugin/associates.rb +58 -45
  21. data/lib/rom/sql/plugin/pagination.rb +8 -11
  22. data/lib/rom/sql/plugins.rb +0 -2
  23. data/lib/rom/sql/projection_dsl.rb +41 -0
  24. data/lib/rom/sql/qualified_attribute.rb +2 -2
  25. data/lib/rom/sql/relation.rb +35 -67
  26. data/lib/rom/sql/relation/reading.rb +77 -25
  27. data/lib/rom/sql/restriction_dsl.rb +24 -0
  28. data/lib/rom/sql/schema.rb +73 -7
  29. data/lib/rom/sql/schema/associations_dsl.rb +4 -3
  30. data/lib/rom/sql/schema/dsl.rb +5 -2
  31. data/lib/rom/sql/schema/inferrer.rb +21 -11
  32. data/lib/rom/sql/transaction.rb +19 -0
  33. data/lib/rom/sql/type.rb +76 -0
  34. data/lib/rom/sql/version.rb +1 -1
  35. data/rom-sql.gemspec +3 -4
  36. data/spec/extensions/postgres/inferrer_spec.rb +19 -9
  37. data/spec/integration/association/many_to_many/custom_fks_spec.rb +73 -0
  38. data/spec/integration/association/many_to_many/from_view_spec.rb +81 -0
  39. data/spec/integration/association/many_to_many_spec.rb +2 -2
  40. data/spec/integration/association/many_to_one/custom_fks_spec.rb +59 -0
  41. data/spec/integration/association/many_to_one/from_view_spec.rb +74 -0
  42. data/spec/integration/association/many_to_one/self_ref_spec.rb +51 -0
  43. data/spec/integration/association/many_to_one_spec.rb +4 -2
  44. data/spec/integration/association/one_to_many/custom_fks_spec.rb +48 -0
  45. data/spec/integration/association/one_to_many/from_view_spec.rb +57 -0
  46. data/spec/integration/association/one_to_many/self_ref_spec.rb +52 -0
  47. data/spec/integration/association/one_to_many_spec.rb +1 -1
  48. data/spec/integration/association/one_to_one_spec.rb +1 -1
  49. data/spec/integration/association/one_to_one_through_spec.rb +2 -2
  50. data/spec/integration/commands/create_spec.rb +11 -27
  51. data/spec/integration/commands/update_spec.rb +54 -109
  52. data/spec/integration/gateway_spec.rb +31 -17
  53. data/spec/integration/plugins/associates_spec.rb +27 -0
  54. data/spec/integration/plugins/auto_wrap_spec.rb +8 -8
  55. data/spec/integration/schema/call_spec.rb +24 -0
  56. data/spec/integration/schema/prefix_spec.rb +18 -0
  57. data/spec/integration/schema/qualified_spec.rb +18 -0
  58. data/spec/integration/schema/rename_spec.rb +23 -0
  59. data/spec/integration/schema/view_spec.rb +29 -0
  60. data/spec/integration/schema_inference_spec.rb +31 -14
  61. data/spec/spec_helper.rb +2 -2
  62. data/spec/support/helpers.rb +7 -0
  63. data/spec/unit/gateway_spec.rb +5 -4
  64. data/spec/unit/projection_dsl_spec.rb +54 -0
  65. data/spec/unit/relation/dataset_spec.rb +3 -3
  66. data/spec/unit/relation/distinct_spec.rb +8 -7
  67. data/spec/unit/relation/exclude_spec.rb +2 -4
  68. data/spec/unit/relation/having_spec.rb +6 -4
  69. data/spec/unit/relation/inner_join_spec.rb +47 -2
  70. data/spec/unit/relation/invert_spec.rb +2 -3
  71. data/spec/unit/relation/left_join_spec.rb +44 -3
  72. data/spec/unit/relation/order_spec.rb +40 -0
  73. data/spec/unit/relation/prefix_spec.rb +2 -0
  74. data/spec/unit/relation/project_spec.rb +3 -1
  75. data/spec/unit/relation/qualified_columns_spec.rb +2 -0
  76. data/spec/unit/relation/rename_spec.rb +2 -0
  77. data/spec/unit/relation/right_join_spec.rb +59 -0
  78. data/spec/unit/relation/select_append_spec.rb +21 -0
  79. data/spec/unit/relation/select_spec.rb +41 -0
  80. data/spec/unit/relation/where_spec.rb +28 -0
  81. data/spec/unit/restriction_dsl_spec.rb +34 -0
  82. metadata +62 -40
  83. data/lib/rom/plugins/relation/sql/base_view.rb +0 -31
  84. data/lib/rom/sql/header.rb +0 -61
  85. data/lib/rom/sql/plugin/assoc_macros.rb +0 -133
  86. data/lib/rom/sql/plugin/assoc_macros/class_interface.rb +0 -128
  87. data/spec/integration/read_spec.rb +0 -111
  88. data/spec/unit/association_errors_spec.rb +0 -19
  89. data/spec/unit/plugin/assoc_macros/combined_associations_spec.rb +0 -73
  90. data/spec/unit/plugin/assoc_macros/many_to_many_spec.rb +0 -53
  91. data/spec/unit/plugin/assoc_macros/many_to_one_spec.rb +0 -61
  92. data/spec/unit/plugin/assoc_macros/one_to_many_spec.rb +0 -78
  93. data/spec/unit/plugin/base_view_spec.rb +0 -18
@@ -1,16 +1,57 @@
1
1
  RSpec.describe ROM::Relation, '#left_join' do
2
- subject(:relation) { container.relations.users }
2
+ subject(:relation) { relations[:users] }
3
+
4
+ let(:tasks) { relations[:tasks] }
3
5
 
4
6
  include_context 'users and tasks'
5
7
 
6
8
  with_adapters do
7
9
  it 'joins relations using left outer join' do
8
- result = relation.left_join(:tasks, user_id: :id).select(:name, :title)
10
+ relation.insert id: 3, name: 'Jade'
11
+
12
+ result = relation.
13
+ left_join(:tasks, user_id: :id).
14
+ select(:name, tasks[:title])
15
+
16
+ expect(result.schema.map(&:name)).to eql(%i[name title])
9
17
 
10
18
  expect(result.to_a).to match_array([
11
19
  { name: 'Joe', title: "Joe's task" },
12
- { name: 'Jane', title: "Jane's task" }
20
+ { name: 'Jane', title: "Jane's task" },
21
+ { name: 'Jade', title: nil }
13
22
  ])
14
23
  end
24
+
25
+ context 'with associations' do
26
+ before do
27
+ conf.relation(:users) do
28
+ schema(infer: true) do
29
+ associations { has_many :tasks }
30
+ end
31
+ end
32
+
33
+ conf.relation(:tasks) do
34
+ schema(infer: true) do
35
+ associations { belongs_to :user }
36
+ end
37
+ end
38
+
39
+ relation.insert id: 3, name: 'Jade'
40
+ end
41
+
42
+ it 'joins relation with join keys inferred' do
43
+ result = relation.
44
+ left_join(tasks).
45
+ select(:name, tasks[:title])
46
+
47
+ expect(result.schema.map(&:name)).to eql(%i[name title])
48
+
49
+ expect(result.to_a).to eql([
50
+ { name: 'Jane', title: "Jane's task" },
51
+ { name: 'Joe', title: "Joe's task" },
52
+ { name: 'Jade', title: nil }
53
+ ])
54
+ end
55
+ end
15
56
  end
16
57
  end
@@ -0,0 +1,40 @@
1
+ RSpec.describe ROM::Relation, '#order' do
2
+ subject(:relation) { relations[:users] }
3
+
4
+ include_context 'users and tasks'
5
+
6
+ before do
7
+ relation.insert(id: 3, name: 'Jade')
8
+ end
9
+
10
+ with_adapters do
11
+ it 'orders by provided attribute names' do
12
+ ordered = relation.order(:name, :id)
13
+
14
+ expect(ordered.to_a).
15
+ to eql([{ id: 3, name: 'Jade' }, { id: 1, name: 'Jane' }, { id: 2, name: 'Joe' }])
16
+ end
17
+
18
+ it 'orders by provided attribute using a block' do
19
+ ordered = relation.
20
+ qualified.
21
+ select(:id, :name).
22
+ left_join(:tasks, user_id: :id).
23
+ order { name.qualified.desc }
24
+
25
+ expect(ordered.to_a).
26
+ to eql([{ id: 2, name: 'Joe' }, { id: 1, name: 'Jane' }, { id: 3, name: 'Jade' }])
27
+ end
28
+
29
+ it 'orders by provided attributes using a block' do
30
+ ordered = relation.
31
+ qualified.
32
+ select(:id, :name).
33
+ left_join(:tasks, user_id: :id).
34
+ order { [name.qualified.desc, id.qualified.desc] }
35
+
36
+ expect(ordered.to_a).
37
+ to eql([{ id: 2, name: 'Joe' }, { id: 1, name: 'Jane' }, { id: 3, name: 'Jade' }])
38
+ end
39
+ end
40
+ end
@@ -5,6 +5,8 @@ RSpec.describe ROM::Relation, '#prefix' do
5
5
 
6
6
  before do
7
7
  conf.relation(:users) do
8
+ schema(infer: true)
9
+
8
10
  def sorted
9
11
  order(:id)
10
12
  end
@@ -5,6 +5,8 @@ RSpec.describe ROM::Relation, '#project' do
5
5
 
6
6
  before do
7
7
  conf.relation(:users) do
8
+ schema(infer: true)
9
+
8
10
  def sorted
9
11
  order(:id)
10
12
  end
@@ -15,7 +17,7 @@ RSpec.describe ROM::Relation, '#project' do
15
17
  it 'projects the dataset using new column names' do
16
18
  projected = relation.sorted.project(:name)
17
19
 
18
- expect(projected.header).to match_array([:name])
20
+ expect(projected.schema.map(&:to_sym)).to match_array([:name])
19
21
  expect(projected.first).to eql(name: 'Jane')
20
22
  end
21
23
  end
@@ -5,6 +5,8 @@ RSpec.describe ROM::Relation, '#qualified_columns' do
5
5
 
6
6
  before do
7
7
  conf.relation(:users) do
8
+ schema(infer: true)
9
+
8
10
  def sorted
9
11
  order(:id)
10
12
  end
@@ -5,6 +5,8 @@ RSpec.describe ROM::Relation, '#rename' do
5
5
 
6
6
  before do
7
7
  conf.relation(:users) do
8
+ schema(infer: true)
9
+
8
10
  def sorted
9
11
  order(:id)
10
12
  end
@@ -0,0 +1,59 @@
1
+ RSpec.describe ROM::Relation, '#right_join' do
2
+ subject(:relation) { relations[:tasks] }
3
+
4
+ let(:users) { relations[:users] }
5
+
6
+ include_context 'users and tasks'
7
+
8
+ with_adapters :postgres, :mysql do
9
+ it 'joins relations using left outer join' do
10
+ users.insert id: 3, name: 'Jade'
11
+ relation.insert id: 3, title: 'Unassigned'
12
+
13
+ result = relation.
14
+ right_join(:users, id: :user_id).
15
+ select(:title, users[:name])
16
+
17
+ expect(result.schema.map(&:name)).to eql(%i[title name])
18
+
19
+ expect(result.to_a).to match_array([
20
+ { name: 'Joe', title: "Joe's task" },
21
+ { name: 'Jane', title: "Jane's task" },
22
+ { name: 'Jade', title: nil }
23
+ ])
24
+ end
25
+
26
+ context 'with associations' do
27
+ before do
28
+ conf.relation(:users) do
29
+ schema(infer: true) do
30
+ associations { has_many :tasks }
31
+ end
32
+ end
33
+
34
+ conf.relation(:tasks) do
35
+ schema(infer: true) do
36
+ associations { belongs_to :user }
37
+ end
38
+ end
39
+ end
40
+
41
+ it 'joins relation with join keys inferred' do
42
+ users.insert id: 3, name: 'Jade'
43
+ relation.insert id: 3, title: 'Unassigned'
44
+
45
+ result = relation.
46
+ right_join(users).
47
+ select(:title, users[:name])
48
+
49
+ expect(result.schema.map(&:name)).to eql(%i[title name])
50
+
51
+ expect(result.to_a).to match_array([
52
+ { name: 'Joe', title: "Joe's task" },
53
+ { name: 'Jane', title: "Jane's task" },
54
+ { name: 'Jade', title: nil }
55
+ ])
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,21 @@
1
+ RSpec.describe ROM::Relation, '#select_append' do
2
+ subject(:relation) { relations[:tasks] }
3
+
4
+ include_context 'users and tasks'
5
+
6
+ with_adapters do
7
+ it 'appends new columns' do
8
+ selected = relation.select(:id).select_append(:title)
9
+
10
+ expect(selected.schema.map(&:name)).to eql(%i[id title])
11
+ expect(selected.first).to eql(id: 1, title: "Joe's task")
12
+ end
13
+
14
+ it 'supports blocks' do
15
+ selected = relation.select(:id).select_append { string::upper(title).as(:title) }
16
+
17
+ expect(selected.schema.map(&:name)).to eql(%i[id title])
18
+ expect(selected.first).to eql(id: 1, title: "JOE'S TASK")
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,41 @@
1
+ RSpec.describe ROM::Relation, '#select' do
2
+ subject(:relation) { container.relations.tasks }
3
+
4
+ include_context 'users and tasks'
5
+
6
+ before do
7
+ conf.relation(:tasks) { schema(infer: true) }
8
+ end
9
+
10
+ with_adapters do
11
+ it 'projects a relation using a list of symbols' do
12
+ expect(relation.select(:id, :title).to_a)
13
+ .to eql([{ id: 1, title: "Joe's task" }, { id: 2, title: "Jane's task"}])
14
+ end
15
+
16
+ it 'projects a relation using a schema' do
17
+ expect(relation.select(*relation.schema.project(:id, :title)).to_a)
18
+ .to eql([{ id: 1, title: "Joe's task" }, { id: 2, title: "Jane's task"}])
19
+ end
20
+
21
+ it 'maintains schema' do
22
+ expect(relation.select(:id, :title).schema.map(&:name)).to eql(%i[id title])
23
+ end
24
+
25
+ it 'supports args and blocks' do
26
+ expect(relation.select(:id) { [title] }.schema.map(&:name)).to eql(%i[id title])
27
+ end
28
+
29
+ it 'supports blocks' do
30
+ expect(relation.select { [id, title] }.schema.map(&:name)).to eql(%i[id title])
31
+ end
32
+
33
+ it 'supports blocks with custom expressions' do
34
+ selected = relation
35
+ .select { [int::count(id).as(:id_count), title.prefixed(:task)] }
36
+ .group { [id, title] }
37
+
38
+ expect(selected.first).to eql(id_count: 1, task_title: "Joe's task")
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,28 @@
1
+ RSpec.describe ROM::Relation, '#where' do
2
+ subject(:relation) { relations[:tasks].select(:id, :title) }
3
+
4
+ include_context 'users and tasks'
5
+
6
+ before do
7
+ conf.relation(:tasks) { schema(infer: true) }
8
+ end
9
+
10
+ with_adapters do
11
+ it 'restricts relation using provided conditions' do
12
+ expect(relation.where(id: 1).to_a).
13
+ to eql([{ id: 1, title: "Joe's task" }])
14
+ end
15
+
16
+ it 'restricts relation using provided conditions and block' do
17
+ expect(relation.where(id: 1) { title.like("%Jane%") }.to_a).to be_empty
18
+ end
19
+
20
+ it 'restricts relation using provided conditions in a block' do
21
+ expect(relation.where { (id > 2) & title.like("%Jane%") }.to_a).to be_empty
22
+ end
23
+
24
+ it 'restricts relation using canonical attributes' do
25
+ expect(relation.rename(id: :user_id).where { id > 3 }.to_a).to be_empty
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe ROM::SQL::RestrictionDSL, :sqlite, helpers: true do
4
+ include_context 'database setup'
5
+
6
+ subject(:dsl) do
7
+ ROM::SQL::RestrictionDSL.new(schema)
8
+ end
9
+
10
+ let(:schema) do
11
+ define_schema(:users, id: ROM::SQL::Types::Serial, name: ROM::SQL::Types::String)
12
+ end
13
+
14
+ let(:ds) do
15
+ conn[:users]
16
+ end
17
+
18
+ describe '#call' do
19
+ it 'evaluates the block and returns an SQL expression' do
20
+ expect(dsl.call { count(id) >= 3 }.sql_literal(conn[:users])).to eql('(count(`id`) >= 3)')
21
+ end
22
+ end
23
+
24
+ describe '#method_missing' do
25
+ it 'responds to methods matching attribute names' do
26
+ expect(dsl.id.type).to eql(schema[:id])
27
+ expect(dsl.name.type).to eql(schema[:name])
28
+ end
29
+
30
+ it 'delegates to sequel virtual row' do
31
+ expect(dsl.count(dsl.id).sql_literal(conn[:users])).to eql('count(`id`)')
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 1.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-23 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.25'
19
+ version: '4.42'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '4.25'
26
+ version: '4.42'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dry-equalizer
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -59,6 +59,9 @@ dependencies:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.2'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 0.2.3
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -66,34 +69,23 @@ dependencies:
66
69
  - - "~>"
67
70
  - !ruby/object:Gem::Version
68
71
  version: '0.2'
69
- - !ruby/object:Gem::Dependency
70
- name: rom
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '2.0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
72
+ - - ">="
81
73
  - !ruby/object:Gem::Version
82
- version: '2.0'
74
+ version: 0.2.3
83
75
  - !ruby/object:Gem::Dependency
84
- name: rom-support
76
+ name: rom
85
77
  requirement: !ruby/object:Gem::Requirement
86
78
  requirements:
87
79
  - - "~>"
88
80
  - !ruby/object:Gem::Version
89
- version: '2.0'
81
+ version: 3.0.0.beta
90
82
  type: :runtime
91
83
  prerelease: false
92
84
  version_requirements: !ruby/object:Gem::Requirement
93
85
  requirements:
94
86
  - - "~>"
95
87
  - !ruby/object:Gem::Version
96
- version: '2.0'
88
+ version: 3.0.0.beta
97
89
  - !ruby/object:Gem::Dependency
98
90
  name: bundler
99
91
  requirement: !ruby/object:Gem::Requirement
@@ -142,7 +134,6 @@ files:
142
134
  - lib/rom-sql.rb
143
135
  - lib/rom/plugins/relation/sql/auto_combine.rb
144
136
  - lib/rom/plugins/relation/sql/auto_wrap.rb
145
- - lib/rom/plugins/relation/sql/base_view.rb
146
137
  - lib/rom/sql.rb
147
138
  - lib/rom/sql/association.rb
148
139
  - lib/rom/sql/association/many_to_many.rb
@@ -157,8 +148,10 @@ files:
157
148
  - lib/rom/sql/commands/error_wrapper.rb
158
149
  - lib/rom/sql/commands/transaction.rb
159
150
  - lib/rom/sql/commands/update.rb
151
+ - lib/rom/sql/dsl.rb
160
152
  - lib/rom/sql/error.rb
161
153
  - lib/rom/sql/errors.rb
154
+ - lib/rom/sql/expression.rb
162
155
  - lib/rom/sql/extensions.rb
163
156
  - lib/rom/sql/extensions/active_support_notifications.rb
164
157
  - lib/rom/sql/extensions/postgres.rb
@@ -166,27 +159,30 @@ files:
166
159
  - lib/rom/sql/extensions/postgres/inferrer.rb
167
160
  - lib/rom/sql/extensions/postgres/types.rb
168
161
  - lib/rom/sql/extensions/rails_log_subscriber.rb
162
+ - lib/rom/sql/function.rb
169
163
  - lib/rom/sql/gateway.rb
170
- - lib/rom/sql/header.rb
171
164
  - lib/rom/sql/migration.rb
172
165
  - lib/rom/sql/migration/migrator.rb
173
166
  - lib/rom/sql/migration/template.rb
174
- - lib/rom/sql/plugin/assoc_macros.rb
175
- - lib/rom/sql/plugin/assoc_macros/class_interface.rb
167
+ - lib/rom/sql/order_dsl.rb
176
168
  - lib/rom/sql/plugin/associates.rb
177
169
  - lib/rom/sql/plugin/pagination.rb
178
170
  - lib/rom/sql/plugins.rb
171
+ - lib/rom/sql/projection_dsl.rb
179
172
  - lib/rom/sql/qualified_attribute.rb
180
173
  - lib/rom/sql/rake_task.rb
181
174
  - lib/rom/sql/relation.rb
182
175
  - lib/rom/sql/relation/reading.rb
183
176
  - lib/rom/sql/relation/writing.rb
177
+ - lib/rom/sql/restriction_dsl.rb
184
178
  - lib/rom/sql/schema.rb
185
179
  - lib/rom/sql/schema/associations_dsl.rb
186
180
  - lib/rom/sql/schema/dsl.rb
187
181
  - lib/rom/sql/schema/inferrer.rb
188
182
  - lib/rom/sql/spec/support.rb
189
183
  - lib/rom/sql/tasks/migration_tasks.rake
184
+ - lib/rom/sql/transaction.rb
185
+ - lib/rom/sql/type.rb
190
186
  - lib/rom/sql/types.rb
191
187
  - lib/rom/sql/version.rb
192
188
  - log/.gitkeep
@@ -195,8 +191,16 @@ files:
195
191
  - spec/extensions/postgres/integration_spec.rb
196
192
  - spec/extensions/postgres/types_spec.rb
197
193
  - spec/fixtures/migrations/20150403090603_create_carrots.rb
194
+ - spec/integration/association/many_to_many/custom_fks_spec.rb
195
+ - spec/integration/association/many_to_many/from_view_spec.rb
198
196
  - spec/integration/association/many_to_many_spec.rb
197
+ - spec/integration/association/many_to_one/custom_fks_spec.rb
198
+ - spec/integration/association/many_to_one/from_view_spec.rb
199
+ - spec/integration/association/many_to_one/self_ref_spec.rb
199
200
  - spec/integration/association/many_to_one_spec.rb
201
+ - spec/integration/association/one_to_many/custom_fks_spec.rb
202
+ - spec/integration/association/one_to_many/from_view_spec.rb
203
+ - spec/integration/association/one_to_many/self_ref_spec.rb
200
204
  - spec/integration/association/one_to_many_spec.rb
201
205
  - spec/integration/association/one_to_one_spec.rb
202
206
  - spec/integration/association/one_to_one_through_spec.rb
@@ -209,8 +213,12 @@ files:
209
213
  - spec/integration/migration_spec.rb
210
214
  - spec/integration/plugins/associates_spec.rb
211
215
  - spec/integration/plugins/auto_wrap_spec.rb
212
- - spec/integration/read_spec.rb
213
216
  - spec/integration/relation_schema_spec.rb
217
+ - spec/integration/schema/call_spec.rb
218
+ - spec/integration/schema/prefix_spec.rb
219
+ - spec/integration/schema/qualified_spec.rb
220
+ - spec/integration/schema/rename_spec.rb
221
+ - spec/integration/schema/view_spec.rb
214
222
  - spec/integration/schema_inference_spec.rb
215
223
  - spec/integration/setup_spec.rb
216
224
  - spec/integration/support/active_support_notifications_spec.rb
@@ -227,17 +235,12 @@ files:
227
235
  - spec/unit/association/one_to_many_spec.rb
228
236
  - spec/unit/association/one_to_one_spec.rb
229
237
  - spec/unit/association/one_to_one_through_spec.rb
230
- - spec/unit/association_errors_spec.rb
231
238
  - spec/unit/gateway_spec.rb
232
239
  - spec/unit/logger_spec.rb
233
240
  - spec/unit/migration_tasks_spec.rb
234
241
  - spec/unit/migrator_spec.rb
235
- - spec/unit/plugin/assoc_macros/combined_associations_spec.rb
236
- - spec/unit/plugin/assoc_macros/many_to_many_spec.rb
237
- - spec/unit/plugin/assoc_macros/many_to_one_spec.rb
238
- - spec/unit/plugin/assoc_macros/one_to_many_spec.rb
239
- - spec/unit/plugin/base_view_spec.rb
240
242
  - spec/unit/plugin/pagination_spec.rb
243
+ - spec/unit/projection_dsl_spec.rb
241
244
  - spec/unit/relation/associations_spec.rb
242
245
  - spec/unit/relation/avg_spec.rb
243
246
  - spec/unit/relation/by_pk_spec.rb
@@ -253,6 +256,7 @@ files:
253
256
  - spec/unit/relation/map_spec.rb
254
257
  - spec/unit/relation/max_spec.rb
255
258
  - spec/unit/relation/min_spec.rb
259
+ - spec/unit/relation/order_spec.rb
256
260
  - spec/unit/relation/pluck_spec.rb
257
261
  - spec/unit/relation/prefix_spec.rb
258
262
  - spec/unit/relation/primary_key_spec.rb
@@ -260,9 +264,14 @@ files:
260
264
  - spec/unit/relation/qualified_columns_spec.rb
261
265
  - spec/unit/relation/read_spec.rb
262
266
  - spec/unit/relation/rename_spec.rb
267
+ - spec/unit/relation/right_join_spec.rb
268
+ - spec/unit/relation/select_append_spec.rb
269
+ - spec/unit/relation/select_spec.rb
263
270
  - spec/unit/relation/sum_spec.rb
264
271
  - spec/unit/relation/union_spec.rb
265
272
  - spec/unit/relation/unique_predicate_spec.rb
273
+ - spec/unit/relation/where_spec.rb
274
+ - spec/unit/restriction_dsl_spec.rb
266
275
  - spec/unit/schema_spec.rb
267
276
  - spec/unit/types_spec.rb
268
277
  homepage: http://rom-rb.org
@@ -280,9 +289,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
280
289
  version: '0'
281
290
  required_rubygems_version: !ruby/object:Gem::Requirement
282
291
  requirements:
283
- - - ">="
292
+ - - ">"
284
293
  - !ruby/object:Gem::Version
285
- version: '0'
294
+ version: 1.3.1
286
295
  requirements: []
287
296
  rubyforge_project:
288
297
  rubygems_version: 2.5.1
@@ -294,8 +303,16 @@ test_files:
294
303
  - spec/extensions/postgres/integration_spec.rb
295
304
  - spec/extensions/postgres/types_spec.rb
296
305
  - spec/fixtures/migrations/20150403090603_create_carrots.rb
306
+ - spec/integration/association/many_to_many/custom_fks_spec.rb
307
+ - spec/integration/association/many_to_many/from_view_spec.rb
297
308
  - spec/integration/association/many_to_many_spec.rb
309
+ - spec/integration/association/many_to_one/custom_fks_spec.rb
310
+ - spec/integration/association/many_to_one/from_view_spec.rb
311
+ - spec/integration/association/many_to_one/self_ref_spec.rb
298
312
  - spec/integration/association/many_to_one_spec.rb
313
+ - spec/integration/association/one_to_many/custom_fks_spec.rb
314
+ - spec/integration/association/one_to_many/from_view_spec.rb
315
+ - spec/integration/association/one_to_many/self_ref_spec.rb
299
316
  - spec/integration/association/one_to_many_spec.rb
300
317
  - spec/integration/association/one_to_one_spec.rb
301
318
  - spec/integration/association/one_to_one_through_spec.rb
@@ -308,8 +325,12 @@ test_files:
308
325
  - spec/integration/migration_spec.rb
309
326
  - spec/integration/plugins/associates_spec.rb
310
327
  - spec/integration/plugins/auto_wrap_spec.rb
311
- - spec/integration/read_spec.rb
312
328
  - spec/integration/relation_schema_spec.rb
329
+ - spec/integration/schema/call_spec.rb
330
+ - spec/integration/schema/prefix_spec.rb
331
+ - spec/integration/schema/qualified_spec.rb
332
+ - spec/integration/schema/rename_spec.rb
333
+ - spec/integration/schema/view_spec.rb
313
334
  - spec/integration/schema_inference_spec.rb
314
335
  - spec/integration/setup_spec.rb
315
336
  - spec/integration/support/active_support_notifications_spec.rb
@@ -326,17 +347,12 @@ test_files:
326
347
  - spec/unit/association/one_to_many_spec.rb
327
348
  - spec/unit/association/one_to_one_spec.rb
328
349
  - spec/unit/association/one_to_one_through_spec.rb
329
- - spec/unit/association_errors_spec.rb
330
350
  - spec/unit/gateway_spec.rb
331
351
  - spec/unit/logger_spec.rb
332
352
  - spec/unit/migration_tasks_spec.rb
333
353
  - spec/unit/migrator_spec.rb
334
- - spec/unit/plugin/assoc_macros/combined_associations_spec.rb
335
- - spec/unit/plugin/assoc_macros/many_to_many_spec.rb
336
- - spec/unit/plugin/assoc_macros/many_to_one_spec.rb
337
- - spec/unit/plugin/assoc_macros/one_to_many_spec.rb
338
- - spec/unit/plugin/base_view_spec.rb
339
354
  - spec/unit/plugin/pagination_spec.rb
355
+ - spec/unit/projection_dsl_spec.rb
340
356
  - spec/unit/relation/associations_spec.rb
341
357
  - spec/unit/relation/avg_spec.rb
342
358
  - spec/unit/relation/by_pk_spec.rb
@@ -352,6 +368,7 @@ test_files:
352
368
  - spec/unit/relation/map_spec.rb
353
369
  - spec/unit/relation/max_spec.rb
354
370
  - spec/unit/relation/min_spec.rb
371
+ - spec/unit/relation/order_spec.rb
355
372
  - spec/unit/relation/pluck_spec.rb
356
373
  - spec/unit/relation/prefix_spec.rb
357
374
  - spec/unit/relation/primary_key_spec.rb
@@ -359,8 +376,13 @@ test_files:
359
376
  - spec/unit/relation/qualified_columns_spec.rb
360
377
  - spec/unit/relation/read_spec.rb
361
378
  - spec/unit/relation/rename_spec.rb
379
+ - spec/unit/relation/right_join_spec.rb
380
+ - spec/unit/relation/select_append_spec.rb
381
+ - spec/unit/relation/select_spec.rb
362
382
  - spec/unit/relation/sum_spec.rb
363
383
  - spec/unit/relation/union_spec.rb
364
384
  - spec/unit/relation/unique_predicate_spec.rb
385
+ - spec/unit/relation/where_spec.rb
386
+ - spec/unit/restriction_dsl_spec.rb
365
387
  - spec/unit/schema_spec.rb
366
388
  - spec/unit/types_spec.rb