draper 4.0.0 → 4.0.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/draper/automatic_delegation.rb +1 -1
- data/lib/draper/compatibility/api_only.rb +2 -2
- data/lib/draper/version.rb +1 -1
- data/spec/draper/decorator_spec.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a90d57e1df50336b735a6f16cc119a558ee8472b70bd9748c59f25b70afc319a
|
4
|
+
data.tar.gz: a4510f40a8afac7976e7afea4659d8e1c3eb981c005bc4046660b4d110874df7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bee71715525fdc2de5336c399b1dfe4a774d9fd68071bb01468c8f31712504cf6af8beecf1f4facf4ea25ef5bcad7a14b2e2f12bec12f7b6f1e55c04318c4f7a
|
7
|
+
data.tar.gz: 8f013f4b36efa767ada401a979e5bf10e28f068997d24fd8035e4025254300709eb7c2e80c5f0498cc49c176b7561fbff48e2cc03f39b418f368c3266bf30359
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Draper Changelog
|
2
2
|
|
3
|
+
## 4.0.1 - 2020-03-25
|
4
|
+
|
5
|
+
### Fixes
|
6
|
+
* Check only object's private methods when preventing delegation [#875](https://github.com/drapergem/draper/pull/875)
|
7
|
+
|
8
|
+
### Other Changes
|
9
|
+
* Use `alias` over `alias_method` [#877](https://github.com/drapergem/draper/pull/877)
|
10
|
+
|
3
11
|
## 4.0.0 - 2020-02-05
|
4
12
|
|
5
13
|
### Breaking Changes
|
@@ -14,9 +14,9 @@ module Draper
|
|
14
14
|
extend ActiveSupport::Concern
|
15
15
|
|
16
16
|
included do
|
17
|
-
|
17
|
+
alias :previous_render_to_body :render_to_body
|
18
18
|
include ActionView::Rendering
|
19
|
-
|
19
|
+
alias :render_to_body :previous_render_to_body
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/lib/draper/version.rb
CHANGED
@@ -684,6 +684,18 @@ module Draper
|
|
684
684
|
expect{ decorator.hello_world }.to raise_error NoMethodError
|
685
685
|
end
|
686
686
|
end
|
687
|
+
|
688
|
+
context 'when delegated method has the same name as private method defined on another object' do
|
689
|
+
let(:decorator_class) { Class.new(Decorator) }
|
690
|
+
let(:object) { Class.new { def print; end }.new }
|
691
|
+
|
692
|
+
it 'delegates the public method defined on the object' do
|
693
|
+
decorator = decorator_class.new(object)
|
694
|
+
|
695
|
+
# `print` private method is defined on `Object`
|
696
|
+
expect{ decorator.print }.not_to raise_error NoMethodError
|
697
|
+
end
|
698
|
+
end
|
687
699
|
end
|
688
700
|
|
689
701
|
context ".method_missing" do
|
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: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Casimir
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-03-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -384,7 +384,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
384
384
|
- !ruby/object:Gem::Version
|
385
385
|
version: '0'
|
386
386
|
requirements: []
|
387
|
-
rubygems_version: 3.0.
|
387
|
+
rubygems_version: 3.0.8
|
388
388
|
signing_key:
|
389
389
|
specification_version: 4
|
390
390
|
summary: View Models for Rails
|