draper 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -3
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -1
- data/README.md +25 -0
- data/draper.gemspec +6 -6
- data/lib/draper.rb +1 -0
- data/lib/draper/collection_decorator.rb +1 -0
- data/lib/draper/configuration.rb +8 -0
- data/lib/draper/decoratable.rb +0 -1
- data/lib/draper/decorated_association.rb +0 -2
- data/lib/draper/finders.rb +0 -1
- data/lib/draper/helper_proxy.rb +0 -1
- data/lib/draper/lazy_helpers.rb +0 -2
- data/lib/draper/query_methods.rb +19 -0
- data/lib/draper/query_methods/load_strategy.rb +21 -0
- data/lib/draper/test_case.rb +2 -2
- data/lib/draper/undecorate.rb +1 -1
- data/lib/draper/version.rb +1 -1
- data/lib/draper/view_context/build_strategy.rb +0 -2
- data/lib/draper/view_helpers.rb +0 -3
- data/spec/draper/collection_decorator_spec.rb +0 -2
- data/spec/draper/configuration_spec.rb +32 -8
- data/spec/draper/decoratable_spec.rb +1 -3
- data/spec/draper/decorated_association_spec.rb +0 -2
- data/spec/draper/factory_spec.rb +0 -4
- data/spec/draper/query_methods/load_strategy_spec.rb +26 -0
- data/spec/draper/query_methods_spec.rb +39 -0
- metadata +21 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c323d66ea5eafcb8aac1d70bdbf02335a7460939bf6dc24a801a37a7c75f6691
|
4
|
+
data.tar.gz: ebd93feddfba45e9c1596b320278bc3ae0886579dbfc6637f7025a6df6e3994c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5977d38ab1436a7dd00cb9e6e8854abdd78d2d21e2a15c00d1b40dade4490909a5d66c73fe64cbea610074096d7ece893fc70b16403fa9090b5de62a2eed2ff6
|
7
|
+
data.tar.gz: b1d4f7faf5afafc5b4820b30bb8f2650fe8c8f936fdde22aedc3198d6b6c21d3299f067da23d96f23a835081bdbef2d71263725f72dce843723f14be3e7216f8
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Draper Changelog
|
2
2
|
|
3
|
+
## 3.1.0
|
4
|
+
* Rails 6 support [#841](https://github.com/drapergem/draper/pull/841)
|
5
|
+
* Include ORM query methods in `CollectionDecorator` (e.g. `includes`) [#845](https://github.com/drapergem/draper/pull/845)
|
6
|
+
* Document the fix for view context leaking in specs [#847](https://github.com/drapergem/draper/pull/847)
|
7
|
+
|
3
8
|
## 3.0.1
|
4
9
|
* Let `decorator_class` infer anonymous class decorator from superclass [#820](https://github.com/drapergem/draper/pull/820)
|
5
10
|
* When inferring decorator fails, show original class instead of `ActiveRecord::Base` [#821](https://github.com/drapergem/draper/pull/821)
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -326,6 +326,17 @@ your `ArticleDecorator` and they'll return decorated objects:
|
|
326
326
|
@article = ArticleDecorator.find(params[:id])
|
327
327
|
```
|
328
328
|
|
329
|
+
### Decorated Query Methods
|
330
|
+
By default, Draper will decorate all [QueryMethods](https://api.rubyonrails.org/classes/ActiveRecord/QueryMethods.html)
|
331
|
+
of ActiveRecord.
|
332
|
+
If you're using another ORM, in order to support it, you can tell Draper to use a custom strategy:
|
333
|
+
|
334
|
+
```ruby
|
335
|
+
Draper.configure do |config|
|
336
|
+
config.default_query_methods_strategy = :mongoid
|
337
|
+
end
|
338
|
+
```
|
339
|
+
|
329
340
|
### When to Decorate Objects
|
330
341
|
|
331
342
|
Decorators are supposed to behave very much like the models they decorate, and
|
@@ -463,6 +474,20 @@ preferred stubbing technique (this example uses RSpec's `stub` method):
|
|
463
474
|
helpers.stub(users_path: '/users')
|
464
475
|
```
|
465
476
|
|
477
|
+
### View context leakage
|
478
|
+
As mentioned before, Draper needs to build a view context to access helper methods. In MiniTest, the view context is
|
479
|
+
cleared during `before_setup` preventing any view context leakage. In RSpec, the view context is cleared before each
|
480
|
+
`decorator`, `controller`, and `mailer` spec. However, if you use decorators in other types of specs
|
481
|
+
(e.g. `job`), you may still experience the view context leaking from the previous spec. To solve this, add the
|
482
|
+
following to your `spec_helper` for each type of spec you are experiencing the leakage:
|
483
|
+
|
484
|
+
```ruby
|
485
|
+
config.before(:each, type: :type) { Draper::ViewContext.clear! }
|
486
|
+
```
|
487
|
+
|
488
|
+
_Note_: The `:type` above is just a placeholder. Replace `:type` with the type of spec you are experiencing
|
489
|
+
the leakage from.
|
490
|
+
|
466
491
|
## Advanced usage
|
467
492
|
|
468
493
|
### Shared Decorator Methods
|
data/draper.gemspec
CHANGED
@@ -17,17 +17,17 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
s.required_ruby_version = '>= 2.2.2'
|
19
19
|
|
20
|
-
s.add_dependency 'activesupport', '
|
21
|
-
s.add_dependency 'actionpack', '
|
22
|
-
s.add_dependency 'request_store', '
|
23
|
-
s.add_dependency 'activemodel', '
|
24
|
-
s.add_dependency 'activemodel-serializers-xml', '
|
20
|
+
s.add_dependency 'activesupport', '>= 5.0'
|
21
|
+
s.add_dependency 'actionpack', '>= 5.0'
|
22
|
+
s.add_dependency 'request_store', '>= 1.0'
|
23
|
+
s.add_dependency 'activemodel', '>= 5.0'
|
24
|
+
s.add_dependency 'activemodel-serializers-xml', '>= 1.0'
|
25
25
|
|
26
26
|
s.add_development_dependency 'ammeter'
|
27
27
|
s.add_development_dependency 'rake'
|
28
28
|
s.add_development_dependency 'rspec-rails'
|
29
29
|
s.add_development_dependency 'minitest-rails'
|
30
30
|
s.add_development_dependency 'capybara'
|
31
|
-
s.add_development_dependency 'active_model_serializers', '
|
31
|
+
s.add_development_dependency 'active_model_serializers', '>= 0.10'
|
32
32
|
s.add_development_dependency 'rubocop'
|
33
33
|
end
|
data/lib/draper.rb
CHANGED
@@ -23,6 +23,7 @@ require 'draper/factory'
|
|
23
23
|
require 'draper/decorated_association'
|
24
24
|
require 'draper/helper_support'
|
25
25
|
require 'draper/view_context'
|
26
|
+
require 'draper/query_methods'
|
26
27
|
require 'draper/collection_decorator'
|
27
28
|
require 'draper/undecorate'
|
28
29
|
require 'draper/decorates_assigned'
|
data/lib/draper/configuration.rb
CHANGED
@@ -11,5 +11,13 @@ module Draper
|
|
11
11
|
def default_controller=(controller)
|
12
12
|
@@default_controller = controller
|
13
13
|
end
|
14
|
+
|
15
|
+
def default_query_methods_strategy
|
16
|
+
@@default_query_methods_strategy ||= :active_record
|
17
|
+
end
|
18
|
+
|
19
|
+
def default_query_methods_strategy=(strategy)
|
20
|
+
@@default_query_methods_strategy = strategy
|
21
|
+
end
|
14
22
|
end
|
15
23
|
end
|
data/lib/draper/decoratable.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module Draper
|
2
2
|
# @private
|
3
3
|
class DecoratedAssociation
|
4
|
-
|
5
4
|
def initialize(owner, association, options)
|
6
5
|
options.assert_valid_keys(:with, :scope, :context)
|
7
6
|
|
@@ -30,6 +29,5 @@ module Draper
|
|
30
29
|
|
31
30
|
@decorated = factory.decorate(associated, context_args: owner.context)
|
32
31
|
end
|
33
|
-
|
34
32
|
end
|
35
33
|
end
|
data/lib/draper/finders.rb
CHANGED
data/lib/draper/helper_proxy.rb
CHANGED
data/lib/draper/lazy_helpers.rb
CHANGED
@@ -3,13 +3,11 @@ module Draper
|
|
3
3
|
# so that you can stop typing `h.` everywhere, at the cost of mixing in a
|
4
4
|
# bazillion methods.
|
5
5
|
module LazyHelpers
|
6
|
-
|
7
6
|
# Sends missing methods to the {HelperProxy}.
|
8
7
|
def method_missing(method, *args, &block)
|
9
8
|
helpers.send(method, *args, &block)
|
10
9
|
rescue NoMethodError
|
11
10
|
super
|
12
11
|
end
|
13
|
-
|
14
12
|
end
|
15
13
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative 'query_methods/load_strategy'
|
2
|
+
|
3
|
+
module Draper
|
4
|
+
module QueryMethods
|
5
|
+
# Proxies missing query methods to the source class if the strategy allows.
|
6
|
+
def method_missing(method, *args, &block)
|
7
|
+
return super unless strategy.allowed? method
|
8
|
+
|
9
|
+
object.send(method, *args, &block).decorate
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
# Configures the strategy used to proxy the query methods, which defaults to `:active_record`.
|
15
|
+
def strategy
|
16
|
+
@strategy ||= LoadStrategy.new(Draper.default_query_methods_strategy)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Draper
|
2
|
+
module QueryMethods
|
3
|
+
module LoadStrategy
|
4
|
+
def self.new(name)
|
5
|
+
const_get(name.to_s.camelize).new
|
6
|
+
end
|
7
|
+
|
8
|
+
class ActiveRecord
|
9
|
+
def allowed?(method)
|
10
|
+
::ActiveRecord::Relation::VALUE_METHODS.include? method
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class Mongoid
|
15
|
+
def allowed?(method)
|
16
|
+
raise NotImplementedError
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/draper/test_case.rb
CHANGED
data/lib/draper/undecorate.rb
CHANGED
data/lib/draper/version.rb
CHANGED
@@ -2,7 +2,6 @@ module Draper
|
|
2
2
|
module ViewContext
|
3
3
|
# @private
|
4
4
|
module BuildStrategy
|
5
|
-
|
6
5
|
def self.new(name, &block)
|
7
6
|
const_get(name.to_s.camelize).new(&block)
|
8
7
|
end
|
@@ -51,7 +50,6 @@ module Draper
|
|
51
50
|
ActionController::TestRequest.method(:create).parameters.first == [:req, :controller_class]
|
52
51
|
end
|
53
52
|
end
|
54
|
-
|
55
53
|
end
|
56
54
|
end
|
57
55
|
end
|
data/lib/draper/view_helpers.rb
CHANGED
@@ -5,7 +5,6 @@ module Draper
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
module ClassMethods
|
8
|
-
|
9
8
|
# Access the helpers proxy to call built-in and user-defined
|
10
9
|
# Rails helpers from a class context.
|
11
10
|
#
|
@@ -14,7 +13,6 @@ module Draper
|
|
14
13
|
Draper::ViewContext.current
|
15
14
|
end
|
16
15
|
alias_method :h, :helpers
|
17
|
-
|
18
16
|
end
|
19
17
|
|
20
18
|
# Access the helpers proxy to call built-in and user-defined
|
@@ -32,6 +30,5 @@ module Draper
|
|
32
30
|
helpers.localize(*args)
|
33
31
|
end
|
34
32
|
alias_method :l, :localize
|
35
|
-
|
36
33
|
end
|
37
34
|
end
|
@@ -7,7 +7,6 @@ module Draper
|
|
7
7
|
|
8
8
|
describe "#initialize" do
|
9
9
|
describe "options validation" do
|
10
|
-
|
11
10
|
it "does not raise error on valid options" do
|
12
11
|
valid_options = {with: Decorator, context: {}}
|
13
12
|
expect{CollectionDecorator.new([], valid_options)}.not_to raise_error
|
@@ -287,6 +286,5 @@ module Draper
|
|
287
286
|
expect(decorator.replace([:foo, :bar])).to be decorator
|
288
287
|
end
|
289
288
|
end
|
290
|
-
|
291
289
|
end
|
292
290
|
end
|
@@ -6,20 +6,44 @@ module Draper
|
|
6
6
|
Draper.configure { |config| expect(config).to be Draper }
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
describe '#default_controller' do
|
10
|
+
it 'defaults default_controller to ApplicationController' do
|
11
|
+
expect(Draper.default_controller).to be ApplicationController
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'allows customizing default_controller through configure' do
|
15
|
+
default = Draper.default_controller
|
16
|
+
|
17
|
+
Draper.configure do |config|
|
18
|
+
config.default_controller = CustomController
|
19
|
+
end
|
20
|
+
|
21
|
+
expect(Draper.default_controller).to be CustomController
|
22
|
+
|
23
|
+
Draper.default_controller = default
|
24
|
+
end
|
11
25
|
end
|
12
26
|
|
13
|
-
|
14
|
-
default
|
27
|
+
describe '#default_query_methods_strategy' do
|
28
|
+
let!(:default) { Draper.default_query_methods_strategy }
|
29
|
+
|
30
|
+
subject { Draper.default_query_methods_strategy }
|
15
31
|
|
16
|
-
|
17
|
-
|
32
|
+
context 'when there is no custom strategy' do
|
33
|
+
it { is_expected.to eq(:active_record) }
|
18
34
|
end
|
19
35
|
|
20
|
-
|
36
|
+
context 'when using a custom strategy' do
|
37
|
+
before do
|
38
|
+
Draper.configure do |config|
|
39
|
+
config.default_query_methods_strategy = :mongoid
|
40
|
+
end
|
41
|
+
end
|
21
42
|
|
22
|
-
|
43
|
+
after { Draper.default_query_methods_strategy = default }
|
44
|
+
|
45
|
+
it { is_expected.to eq(:mongoid) }
|
46
|
+
end
|
23
47
|
end
|
24
48
|
end
|
25
49
|
end
|
@@ -3,7 +3,6 @@ require 'support/shared_examples/decoratable_equality'
|
|
3
3
|
|
4
4
|
module Draper
|
5
5
|
describe Decoratable do
|
6
|
-
|
7
6
|
describe "#decorate" do
|
8
7
|
it "returns a decorator for self" do
|
9
8
|
product = Product.new
|
@@ -11,7 +10,7 @@ module Draper
|
|
11
10
|
|
12
11
|
expect(decorator).to be_a ProductDecorator
|
13
12
|
expect(decorator.object).to be product
|
14
|
-
|
13
|
+
end
|
15
14
|
|
16
15
|
it "accepts context" do
|
17
16
|
context = {some: "context"}
|
@@ -232,6 +231,5 @@ module Draper
|
|
232
231
|
end
|
233
232
|
end
|
234
233
|
end
|
235
|
-
|
236
234
|
end
|
237
235
|
end
|
@@ -2,7 +2,6 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module Draper
|
4
4
|
describe DecoratedAssociation do
|
5
|
-
|
6
5
|
describe "#initialize" do
|
7
6
|
it "accepts valid options" do
|
8
7
|
valid_options = {with: Decorator, scope: :foo, context: {}}
|
@@ -79,6 +78,5 @@ module Draper
|
|
79
78
|
end
|
80
79
|
end
|
81
80
|
end
|
82
|
-
|
83
81
|
end
|
84
82
|
end
|
data/spec/draper/factory_spec.rb
CHANGED
@@ -2,7 +2,6 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module Draper
|
4
4
|
describe Factory do
|
5
|
-
|
6
5
|
describe "#initialize" do
|
7
6
|
it "accepts valid options" do
|
8
7
|
valid_options = {with: Decorator, context: {foo: "bar"}}
|
@@ -88,11 +87,9 @@ module Draper
|
|
88
87
|
end
|
89
88
|
end
|
90
89
|
end
|
91
|
-
|
92
90
|
end
|
93
91
|
|
94
92
|
describe Factory::Worker do
|
95
|
-
|
96
93
|
describe "#call" do
|
97
94
|
it "calls the decorator method" do
|
98
95
|
object = double
|
@@ -246,6 +243,5 @@ module Draper
|
|
246
243
|
end
|
247
244
|
end
|
248
245
|
end
|
249
|
-
|
250
246
|
end
|
251
247
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'active_record'
|
3
|
+
|
4
|
+
module Draper
|
5
|
+
module QueryMethods
|
6
|
+
describe LoadStrategy do
|
7
|
+
describe '#new' do
|
8
|
+
subject { described_class.new(:active_record) }
|
9
|
+
|
10
|
+
it { is_expected.to be_an_instance_of(LoadStrategy::ActiveRecord) }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe LoadStrategy::ActiveRecord do
|
15
|
+
describe '#allowed?' do
|
16
|
+
it 'checks whether or not ActiveRecord::Relation::VALUE_METHODS has the given method' do
|
17
|
+
allow(::ActiveRecord::Relation::VALUE_METHODS).to receive(:include?)
|
18
|
+
|
19
|
+
described_class.new.allowed? :foo
|
20
|
+
|
21
|
+
expect(::ActiveRecord::Relation::VALUE_METHODS).to have_received(:include?).with(:foo)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require_relative '../dummy/app/decorators/post_decorator'
|
3
|
+
|
4
|
+
Post = Struct.new(:id) { }
|
5
|
+
|
6
|
+
module Draper
|
7
|
+
describe QueryMethods do
|
8
|
+
describe '#method_missing' do
|
9
|
+
let(:collection) { [ Post.new, Post.new ] }
|
10
|
+
let(:collection_decorator) { PostDecorator.decorate_collection(collection) }
|
11
|
+
let(:fake_strategy) { instance_double(QueryMethods::LoadStrategy::ActiveRecord) }
|
12
|
+
|
13
|
+
before { allow(QueryMethods::LoadStrategy).to receive(:new).and_return(fake_strategy) }
|
14
|
+
|
15
|
+
context 'when strategy allows collection to call the method' do
|
16
|
+
let(:results) { spy(:results) }
|
17
|
+
|
18
|
+
before do
|
19
|
+
allow(fake_strategy).to receive(:allowed?).with(:some_query_method).and_return(true)
|
20
|
+
allow(collection).to receive(:send).with(:some_query_method).and_return(results)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'calls the method on the collection and decorate it results' do
|
24
|
+
collection_decorator.some_query_method
|
25
|
+
|
26
|
+
expect(results).to have_received(:decorate)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'when strategy does not allow collection to call the method' do
|
31
|
+
before { allow(fake_strategy).to receive(:allowed?).with(:some_query_method).and_return(false) }
|
32
|
+
|
33
|
+
it 'raises NoMethodError' do
|
34
|
+
expect { collection_decorator.some_query_method }.to raise_exception(NoMethodError)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: draper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Casimir
|
@@ -9,76 +9,76 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '5.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '5.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: actionpack
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '5.0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '5.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: request_store
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '1.0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - "
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '1.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: activemodel
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '5.0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '5.0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: activemodel-serializers-xml
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '1.0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '1.0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
@@ -155,14 +155,14 @@ dependencies:
|
|
155
155
|
name: active_model_serializers
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- - "
|
158
|
+
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0.10'
|
161
161
|
type: :development
|
162
162
|
prerelease: false
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- - "
|
165
|
+
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0.10'
|
168
168
|
- !ruby/object:Gem::Dependency
|
@@ -220,6 +220,8 @@ files:
|
|
220
220
|
- lib/draper/helper_proxy.rb
|
221
221
|
- lib/draper/helper_support.rb
|
222
222
|
- lib/draper/lazy_helpers.rb
|
223
|
+
- lib/draper/query_methods.rb
|
224
|
+
- lib/draper/query_methods/load_strategy.rb
|
223
225
|
- lib/draper/railtie.rb
|
224
226
|
- lib/draper/tasks/test.rake
|
225
227
|
- lib/draper/test/devise_helper.rb
|
@@ -255,6 +257,8 @@ files:
|
|
255
257
|
- spec/draper/finders_spec.rb
|
256
258
|
- spec/draper/helper_proxy_spec.rb
|
257
259
|
- spec/draper/lazy_helpers_spec.rb
|
260
|
+
- spec/draper/query_methods/load_strategy_spec.rb
|
261
|
+
- spec/draper/query_methods_spec.rb
|
258
262
|
- spec/draper/undecorate_chain_spec.rb
|
259
263
|
- spec/draper/undecorate_spec.rb
|
260
264
|
- spec/draper/view_context/build_strategy_spec.rb
|
@@ -364,8 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
364
368
|
- !ruby/object:Gem::Version
|
365
369
|
version: '0'
|
366
370
|
requirements: []
|
367
|
-
|
368
|
-
rubygems_version: 2.6.11
|
371
|
+
rubygems_version: 3.0.2
|
369
372
|
signing_key:
|
370
373
|
specification_version: 4
|
371
374
|
summary: View Models for Rails
|
@@ -382,6 +385,8 @@ test_files:
|
|
382
385
|
- spec/draper/finders_spec.rb
|
383
386
|
- spec/draper/helper_proxy_spec.rb
|
384
387
|
- spec/draper/lazy_helpers_spec.rb
|
388
|
+
- spec/draper/query_methods/load_strategy_spec.rb
|
389
|
+
- spec/draper/query_methods_spec.rb
|
385
390
|
- spec/draper/undecorate_chain_spec.rb
|
386
391
|
- spec/draper/undecorate_spec.rb
|
387
392
|
- spec/draper/view_context/build_strategy_spec.rb
|