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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a855bb5a5b2a7810e08850debb930d60b7675a3
4
- data.tar.gz: 11d92465273c6867f71c92027c9866465169b4ea
3
+ metadata.gz: 32cc540a94d0c4151aa9ccc05f8ecdd075643b1d
4
+ data.tar.gz: ae85f4549a24440613e4dca88f9f770e8e6b2f1f
5
5
  SHA512:
6
- metadata.gz: 40b0e9630767955088a50dd9c705431ea5dbfa0765fbfd9d363503737cfb52730bc4ce8f5a2dc2cc8992a6dc3a044aec74270ff4f730d7e6746d50f080e2747f
7
- data.tar.gz: f8a888c5d6474ceb8d629ba0abc8c48dd87f6f3db6cca473b339a42e3cf66b20c14ca2c3fa3bbc4a55aae89a8385d281c3688c7174035bd5c7080fb6158198ef
6
+ metadata.gz: c035b1cb9156d73057f019fdc1a6c1f0ded63563570333f212a7d47719cc40d827f099eda3759fe5656fdcfc19ba1739b8f8f1f329bfe79a51a159ed2d5263c2
7
+ data.tar.gz: bffdaf8dd9ffb4fe61944266f735292a6dec5e8d008e7d6825acec4d2c5033bae2eecdf70db51da3e7ec209db7ddbe2a8dc987df6af59092039290dbdb04d526
@@ -4,16 +4,16 @@ script: bundle exec rake test
4
4
 
5
5
  rvm:
6
6
  - 2.0.0
7
- - 2.1.8
7
+ - 2.1.10
8
8
  - 2.2.4
9
- - 2.3.0
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.beta1
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.beta1
26
- - rvm: 2.1.8
27
- gemfile: gemfiles/Gemfile-rails.5.0.0.beta1
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
@@ -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) }
@@ -7,4 +7,3 @@ gem 'test-unit-rails'
7
7
  gem 'capybara'
8
8
  gem 'sqlite3'
9
9
  gem 'jbuilder'
10
- gem 'test-unit'
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'active_decorator', path: '..'
4
4
 
5
- gem 'rails', '~> 5.0.0.beta1'
5
+ gem 'rails', '~> 5.0.0.beta4'
6
6
  gem 'test-unit-rails'
7
7
  gem 'capybara'
8
8
  gem 'sqlite3'
@@ -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.extend ActiveDecorator::RelationDecorator
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 RelationDecorator
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
@@ -2,6 +2,8 @@ module ActiveDecorator
2
2
  module Monkey
3
3
  module ActionView
4
4
  module PartialRenderer
5
+ private
6
+
5
7
  def setup(*)
6
8
  super
7
9
 
@@ -1,3 +1,3 @@
1
1
  module ActiveDecorator
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  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.0
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-01-22 00:00:00.000000000 Z
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.beta1
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: active_decorator
87
- rubygems_version: 2.5.1
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