rom 1.0.0.beta2 → 1.0.0.rc1

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
  SHA1:
3
- metadata.gz: af2e4985b3912be1a9942114f7a9046e424450fe
4
- data.tar.gz: 9cf96e69185a58d5018a9d995aac749f80bda4bc
3
+ metadata.gz: 1eab20d270a39e65a4d1f5e2e41156e54a8eafbd
4
+ data.tar.gz: 15a527fedc410f638e188b33a97118978c7dffe0
5
5
  SHA512:
6
- metadata.gz: 7f8e4877c911b76cdfee5b391ee4de5e5cc858ccfe4469ab0755495d47eb6091f9afcfc4289fd6247f6f00b7848cacef67f8c2e75309d7023354f2a0c39ff7a2
7
- data.tar.gz: 25102c27b87b024b58870441bd3b38a7aa2ee334e1b23200c0f27d2abc6ff1b8b29df86327c397ea6dad9251b33eb6092450e1d3579d85e21b3f520d749ed3aa
6
+ metadata.gz: 676f11bdda029acf7704e36ec088454d3c076640a922da42c4c9871d4dc7362decf3b8c4c878fe90dc467a6adc7eb61baa3d48e124fb9cace4525d3a973fd78f
7
+ data.tar.gz: f490fc9f8e7c617d8738c2e9205254e43ceaf4de6a4a1c435f9d4c386ad3e3fee5166acf0d326a5a5e96e5aa46bb7f3eb5948e1f4f7f9b38c3ca5851739a9f5d
@@ -20,6 +20,10 @@
20
20
  in the input (solnic)
21
21
  - Command graph no longer rescues from any exception (solnic)
22
22
 
23
+ ### Fixed
24
+
25
+ - `Relation.register_as` properly overrides inherited value (solnic)
26
+
23
27
  [Compare v0.9.1...HEAD](https://github.com/rom-rb/rom/compare/v0.9.1...HEAD)
24
28
 
25
29
  ## v0.9.1 2015-08-21
@@ -77,6 +77,8 @@ module ROM
77
77
  # @api public
78
78
  def self.register_as(value = Undefined)
79
79
  if value == Undefined
80
+ return @register_as if defined?(@register_as)
81
+
80
82
  super_val = super()
81
83
 
82
84
  if superclass == ROM::Relation[adapter]
@@ -1,3 +1,3 @@
1
1
  module ROM
2
- VERSION = '1.0.0.beta2'.freeze
2
+ VERSION = '1.0.0.rc1'.freeze
3
3
  end
@@ -16,8 +16,8 @@ Gem::Specification.new do |gem|
16
16
  gem.license = 'MIT'
17
17
 
18
18
  gem.add_runtime_dependency 'dry-equalizer', '~> 0.2'
19
- gem.add_runtime_dependency 'rom-support', '~> 1.0.0.beta1'
20
- gem.add_runtime_dependency 'rom-mapper', '~> 0.3.0.beta1'
19
+ gem.add_runtime_dependency 'rom-support', '~> 1.0.0.rc1'
20
+ gem.add_runtime_dependency 'rom-mapper', '~> 0.3.0.rc1'
21
21
 
22
22
  gem.add_development_dependency 'rake', '~> 10.3'
23
23
  gem.add_development_dependency 'rspec', '~> 3.3'
@@ -76,14 +76,14 @@ describe ROM::Relation do
76
76
  expect(Test::Users.register_as).to eq(:guests)
77
77
  end
78
78
 
79
- it "defaults to :name for descendant classes" do
79
+ it "defaults to :dataset of parent class" do
80
80
  class Test::SuperUsers < ROM::Relation[:memory]
81
81
  dataset :users
82
82
  end
83
83
 
84
84
  class Test::DescendantUsers < Test::SuperUsers; end
85
85
 
86
- expect(Test::DescendantUsers.register_as).to eq(:test_descendant_users)
86
+ expect(Test::DescendantUsers.register_as).to be(:users)
87
87
  end
88
88
 
89
89
  it "sets custom value for super and descendant classes" do
@@ -98,6 +98,20 @@ describe ROM::Relation do
98
98
  expect(Test::SuperUsers.register_as).to eq(:users)
99
99
  expect(Test::DescendantUsers.register_as).to eq(:descendant_users)
100
100
  end
101
+
102
+ it "sets provided value overriding inherited value" do
103
+ module Test
104
+ class BaseRelation < ROM::Relation[:memory]
105
+ end
106
+
107
+ class UsersRelation < BaseRelation
108
+ register_as :users
109
+ dataset :users
110
+ end
111
+ end
112
+
113
+ expect(Test::UsersRelation.register_as).to be(:users)
114
+ end
101
115
  end
102
116
 
103
117
  describe '#name' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta2
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Solnica
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-25 00:00:00.000000000 Z
11
+ date: 2015-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-equalizer
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0.beta1
33
+ version: 1.0.0.rc1
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.0.beta1
40
+ version: 1.0.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rom-mapper
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.0.beta1
47
+ version: 0.3.0.rc1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.3.0.beta1
54
+ version: 0.3.0.rc1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -281,9 +281,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  version: 1.3.1
282
282
  requirements: []
283
283
  rubyforge_project:
284
- rubygems_version: 2.4.5
284
+ rubygems_version: 2.4.5.1
285
285
  signing_key:
286
286
  specification_version: 4
287
287
  summary: Ruby Object Mapper
288
288
  test_files: []
289
- has_rdoc: