rom-relation 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.md ADDED
@@ -0,0 +1,9 @@
1
+ # v0.1.1 2013-08-30
2
+
3
+ * [feature] Integration with axiom-optimizer (solnic)
4
+
5
+ [Compare v0.1.0..v0.1.1](https://github.com/rom-rb/rom-relation/compare/v0.1.0...v0.1.1)
6
+
7
+ # v0.1.0 2013-08-23
8
+
9
+ First public release
data/lib/rom-relation.rb CHANGED
@@ -8,6 +8,7 @@ require 'abstract_type'
8
8
  require 'descendants_tracker'
9
9
  require 'equalizer'
10
10
  require 'axiom'
11
+ require 'axiom-optimizer'
11
12
 
12
13
  # Main ROM module with methods to setup and manage the environment
13
14
  module ROM
data/lib/rom/relation.rb CHANGED
@@ -55,7 +55,7 @@ module ROM
55
55
  #
56
56
  # @api public
57
57
  def self.build(relation, mapper)
58
- new(mapper.call(relation), mapper)
58
+ new(mapper.call(relation).optimize, mapper)
59
59
  end
60
60
 
61
61
  # Iterate over tuples yielded by the wrapped relation
data/lib/rom/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ROM
4
4
  class Relation
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
data/rom-relation.gemspec CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
22
22
  gem.add_dependency 'abstract_type', '~> 0.0.6'
23
23
  gem.add_dependency 'adamantium', '~> 0.1'
24
24
  gem.add_dependency 'axiom', '~> 0.1.1'
25
- gem.add_dependency 'axiom-optimizer', '~> 0.1.0'
25
+ gem.add_dependency 'axiom-optimizer', '~> 0.1.1'
26
26
  end
@@ -46,10 +46,10 @@ describe Mapping, '.build' do
46
46
  end
47
47
  end
48
48
 
49
- context 'when custom mapper is inject' do
49
+ context 'when custom mapper is injected' do
50
50
  subject { env }
51
51
 
52
- fake(:test_mapper) { TestMapper }
52
+ let(:test_mapper) { TestMapper.new(header, model) }
53
53
 
54
54
  before do
55
55
  custom_mapper = test_mapper
@@ -57,11 +57,7 @@ describe Mapping, '.build' do
57
57
  end
58
58
 
59
59
  it 'sets the custom mapper' do
60
- stub(test_mapper).call(relation) { relation }
61
-
62
60
  expect(subject[:users].mapper).to be(test_mapper)
63
-
64
- expect(test_mapper).to have_received.call(relation)
65
61
  end
66
62
  end
67
63
 
@@ -5,15 +5,16 @@ require 'spec_helper'
5
5
  describe Relation, '.build' do
6
6
  subject { described_class.build(relation, mapper) }
7
7
 
8
- fake(:relation) { Axiom::Relation }
9
- fake(:mapper) { Mapper }
10
-
11
- let(:mapped_relation) { mock('mapped_relation') }
8
+ fake(:relation) { Axiom::Relation }
9
+ fake(:mapped) { Axiom::Relation }
10
+ fake(:optimized) { Axiom::Relation }
11
+ fake(:mapper) { Mapper }
12
12
 
13
13
  before do
14
- stub(mapper).call(relation) { mapped_relation }
14
+ stub(mapper).call(relation) { mapped }
15
+ stub(mapped).optimize { optimized }
15
16
  end
16
17
 
17
- its(:relation) { should be(mapped_relation) }
18
+ its(:relation) { should be(optimized) }
18
19
  its(:mapper) { should be(mapper) }
19
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rom-relation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-23 00:00:00.000000000 Z
12
+ date: 2013-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -136,7 +136,7 @@ dependencies:
136
136
  requirements:
137
137
  - - ~>
138
138
  - !ruby/object:Gem::Version
139
- version: 0.1.0
139
+ version: 0.1.1
140
140
  type: :runtime
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ dependencies:
144
144
  requirements:
145
145
  - - ~>
146
146
  - !ruby/object:Gem::Version
147
- version: 0.1.0
147
+ version: 0.1.1
148
148
  description: Relation schema with mapping for ROM
149
149
  email: piotr.solnica@gmail.com
150
150
  executables: []
@@ -157,6 +157,7 @@ files:
157
157
  - .ruby-version
158
158
  - .travis.yml
159
159
  - .yardopts
160
+ - Changelog.md
160
161
  - Gemfile
161
162
  - Gemfile.devtools
162
163
  - Guardfile