active_decorator 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -6
- data/active_decorator.gemspec +0 -2
- data/gemfiles/Gemfile-rails.4.0.x +0 -1
- data/gemfiles/{Gemfile-rails.5.0.0.beta1 → Gemfile-rails.5.0.0.rc1} +1 -1
- data/lib/active_decorator/decorator.rb +16 -2
- data/lib/active_decorator/monkey/action_view/partial_renderer.rb +2 -0
- data/lib/active_decorator/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32cc540a94d0c4151aa9ccc05f8ecdd075643b1d
|
4
|
+
data.tar.gz: ae85f4549a24440613e4dca88f9f770e8e6b2f1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c035b1cb9156d73057f019fdc1a6c1f0ded63563570333f212a7d47719cc40d827f099eda3759fe5656fdcfc19ba1739b8f8f1f329bfe79a51a159ed2d5263c2
|
7
|
+
data.tar.gz: bffdaf8dd9ffb4fe61944266f735292a6dec5e8d008e7d6825acec4d2c5033bae2eecdf70db51da3e7ec209db7ddbe2a8dc987df6af59092039290dbdb04d526
|
data/.travis.yml
CHANGED
@@ -4,16 +4,16 @@ script: bundle exec rake test
|
|
4
4
|
|
5
5
|
rvm:
|
6
6
|
- 2.0.0
|
7
|
-
- 2.1.
|
7
|
+
- 2.1.10
|
8
8
|
- 2.2.4
|
9
|
-
- 2.3.
|
9
|
+
- 2.3.1
|
10
10
|
- ruby-head
|
11
11
|
gemfile:
|
12
12
|
- gemfiles/Gemfile-rails.3.2.x
|
13
13
|
- gemfiles/Gemfile-rails.4.0.x
|
14
14
|
- gemfiles/Gemfile-rails.4.1.x
|
15
15
|
- gemfiles/Gemfile-rails.4.2.x
|
16
|
-
- gemfiles/Gemfile-rails.5.0.0.
|
16
|
+
- gemfiles/Gemfile-rails.5.0.0.rc1
|
17
17
|
|
18
18
|
sudo: false
|
19
19
|
|
@@ -22,8 +22,8 @@ matrix:
|
|
22
22
|
- rvm: ruby-head
|
23
23
|
gemfile: gemfiles/Gemfile-rails.3.2.x
|
24
24
|
- rvm: 2.0.0
|
25
|
-
gemfile: gemfiles/Gemfile-rails.5.0.0.
|
26
|
-
- rvm: 2.1.
|
27
|
-
gemfile: gemfiles/Gemfile-rails.5.0.0.
|
25
|
+
gemfile: gemfiles/Gemfile-rails.5.0.0.rc1
|
26
|
+
- rvm: 2.1.10
|
27
|
+
gemfile: gemfiles/Gemfile-rails.5.0.0.rc1
|
28
28
|
allow_failures:
|
29
29
|
- rvm: ruby-head
|
data/active_decorator.gemspec
CHANGED
@@ -11,8 +11,6 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = %q{A simple and Rubyish view helper for Rails}
|
12
12
|
s.description = %q{A simple and Rubyish view helper for Rails}
|
13
13
|
|
14
|
-
s.rubyforge_project = "active_decorator"
|
15
|
-
|
16
14
|
s.files = `git ls-files`.split("\n")
|
17
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
@@ -19,7 +19,13 @@ module ActiveDecorator
|
|
19
19
|
end
|
20
20
|
elsif defined?(ActiveRecord) && obj.is_a?(ActiveRecord::Relation) && !obj.is_a?(ActiveDecorator::RelationDecorator)
|
21
21
|
# don't call each nor to_a immediately
|
22
|
-
obj.
|
22
|
+
if obj.respond_to?(:records)
|
23
|
+
# Rails 5.0
|
24
|
+
obj.extend ActiveDecorator::RelationDecorator
|
25
|
+
else
|
26
|
+
# Rails 3.x and 4.x
|
27
|
+
obj.extend ActiveDecorator::RelationDecoratorLegacy
|
28
|
+
end
|
23
29
|
else
|
24
30
|
d = decorator_for obj.class
|
25
31
|
return obj unless d
|
@@ -50,11 +56,19 @@ module ActiveDecorator
|
|
50
56
|
end
|
51
57
|
end
|
52
58
|
|
53
|
-
module
|
59
|
+
module RelationDecoratorLegacy
|
54
60
|
def to_a
|
55
61
|
super.tap do |arr|
|
56
62
|
ActiveDecorator::Decorator.instance.decorate arr
|
57
63
|
end
|
58
64
|
end
|
59
65
|
end
|
66
|
+
|
67
|
+
module RelationDecorator
|
68
|
+
def records
|
69
|
+
super.tap do |arr|
|
70
|
+
ActiveDecorator::Decorator.instance.decorate arr
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
60
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple and Rubyish view helper for Rails
|
14
14
|
email:
|
@@ -28,7 +28,7 @@ files:
|
|
28
28
|
- gemfiles/Gemfile-rails.4.0.x
|
29
29
|
- gemfiles/Gemfile-rails.4.1.x
|
30
30
|
- gemfiles/Gemfile-rails.4.2.x
|
31
|
-
- gemfiles/Gemfile-rails.5.0.0.
|
31
|
+
- gemfiles/Gemfile-rails.5.0.0.rc1
|
32
32
|
- lib/active_decorator.rb
|
33
33
|
- lib/active_decorator/config.rb
|
34
34
|
- lib/active_decorator/decorator.rb
|
@@ -83,8 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubyforge_project:
|
87
|
-
rubygems_version: 2.
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.6.3
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: A simple and Rubyish view helper for Rails
|