active_decorator_with_decorate_associations 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +18 -0
- data/README.md +4 -13
- data/active_decorator_with_decorate_associations.gemspec +4 -1
- data/gemfiles/Gemfile-rails.3.2.x +20 -0
- data/gemfiles/Gemfile-rails.4.0.x +9 -0
- data/gemfiles/Gemfile-rails.4.1.x +9 -0
- data/gemfiles/Gemfile-rails.4.2.x +9 -0
- data/gemfiles/Gemfile-rails.5.0.0.beta3 +9 -0
- data/lib/active_decorator_with_decorate_associations/active_decorator_extension.rb +5 -0
- data/lib/active_decorator_with_decorate_associations/decorator.rb +2 -1
- data/lib/active_decorator_with_decorate_associations/marker.rb +4 -0
- data/lib/active_decorator_with_decorate_associations/version.rb +1 -1
- metadata +56 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 637a12419320e2680e0faa087bfd841397cee7ae
|
4
|
+
data.tar.gz: 37dd361d22fb974839bf73b44d3d87b7e4f7a5b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1795ab7f39e144adb5f5ac558513d5fa1cafad231beadd2e83ff0b51c3746df3ba07900b60e724d31d46a5a06d40af9b64546097bc53424e170c7f0d4b1ce963
|
7
|
+
data.tar.gz: db042cf412f6dc4e6aefc24649435ad6f6f47d1c1a9374bb416f233688cf1cbdfbbd553b0ed53b2a8e5c73db0c897ad13ca07e8856584d09ad6a879acaac945e
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -8,5 +8,23 @@ rvm:
|
|
8
8
|
- 2.2.4
|
9
9
|
- 2.3.0
|
10
10
|
- ruby-head
|
11
|
+
gemfile:
|
12
|
+
- gemfiles/Gemfile-rails.3.2.x
|
13
|
+
- gemfiles/Gemfile-rails.4.0.x
|
14
|
+
- gemfiles/Gemfile-rails.4.1.x
|
15
|
+
- gemfiles/Gemfile-rails.4.2.x
|
16
|
+
- gemfiles/Gemfile-rails.5.0.0.beta3
|
11
17
|
|
12
18
|
sudo: false
|
19
|
+
|
20
|
+
matrix:
|
21
|
+
exclude:
|
22
|
+
- rvm: ruby-head
|
23
|
+
gemfile: gemfiles/Gemfile-rails.3.2.x
|
24
|
+
- rvm: 2.0.0
|
25
|
+
gemfile: gemfiles/Gemfile-rails.5.0.0.beta3
|
26
|
+
- rvm: 2.1.8
|
27
|
+
gemfile: gemfiles/Gemfile-rails.5.0.0.beta3
|
28
|
+
allow_failures:
|
29
|
+
- rvm: ruby-head
|
30
|
+
- gemfile: gemfiles/Gemfile-rails.5.0.0.beta3
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# ActiveDecoratorWithDecorateAssociations
|
1
|
+
# ActiveDecoratorWithDecorateAssociations [](https://travis-ci.org/itkrt2y/active_decorator_with_decorate_associations)
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Enable active_decorator to automatically decorate associated models
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,20 +20,13 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
23
|
+
See active_decorator
|
24
|
+
https://github.com/amatsuda/active_decorator
|
32
25
|
|
33
26
|
## Contributing
|
34
27
|
|
35
28
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/active_decorator_with_decorate_associations.
|
36
29
|
|
37
|
-
|
38
30
|
## License
|
39
31
|
|
40
32
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
@@ -21,5 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "rails", ">= 3.2"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.11"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
-
spec.add_development_dependency "
|
24
|
+
spec.add_development_dependency "test-unit-rails"
|
25
|
+
spec.add_development_dependency "capybara"
|
26
|
+
spec.add_development_dependency "sqlite3"
|
27
|
+
spec.add_development_dependency "jbuilder", ">= 2.3.1"
|
25
28
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'active_decorator_with_decorate_associations', path: '..'
|
4
|
+
|
5
|
+
gem 'rails', '~> 3.2.0'
|
6
|
+
gem 'test-unit-rails', '1.0.2'
|
7
|
+
if RUBY_VERSION <= '1.8.7'
|
8
|
+
gem 'i18n', '~> 0.6.11'
|
9
|
+
end
|
10
|
+
gem 'capybara', '~> 2.0.0'
|
11
|
+
# rubyzip >=1 doesn't support ruby 1.8
|
12
|
+
gem 'rubyzip', '< 1.0.0'
|
13
|
+
gem 'sqlite3'
|
14
|
+
gem 'nokogiri', '~> 1.5.0'
|
15
|
+
if RUBY_VERSION <= '1.8.7'
|
16
|
+
gem 'jbuilder', '< 2'
|
17
|
+
else
|
18
|
+
gem 'jbuilder'
|
19
|
+
end
|
20
|
+
gem 'test-unit'
|
@@ -2,11 +2,16 @@
|
|
2
2
|
# https://github.com/amatsuda/active_decorator/pull/15
|
3
3
|
# https://github.com/amatsuda/active_decorator/pull/59
|
4
4
|
|
5
|
+
require "active_decorator_with_decorate_associations/marker"
|
6
|
+
|
5
7
|
module ActiveDecoratorExtension
|
6
8
|
def decorate(obj)
|
7
9
|
return if defined?(Jbuilder) && Jbuilder === obj
|
8
10
|
return if obj.nil?
|
11
|
+
|
9
12
|
super
|
13
|
+
|
14
|
+
obj.extend ActiveDecoratorWithDecorateAssociations::Marker if obj.is_a?(ActiveRecord::Base)
|
10
15
|
obj
|
11
16
|
end
|
12
17
|
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
require "active_decorator"
|
2
|
+
require "active_decorator_with_decorate_associations/marker"
|
2
3
|
|
3
4
|
module ActiveDecoratorWithDecorateAssociations
|
4
5
|
class Decorator
|
5
6
|
include Singleton
|
6
7
|
|
7
8
|
def decorate(owner, target)
|
8
|
-
if owner.is_a?(
|
9
|
+
if owner.is_a?(ActiveDecoratorWithDecorateAssociations::Marker)
|
9
10
|
ActiveDecorator::Decorator.instance.decorate(target)
|
10
11
|
else
|
11
12
|
target
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_decorator_with_decorate_associations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatsuya Itakura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_decorator
|
@@ -67,19 +67,61 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '10.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: test-unit-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: capybara
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: sqlite3
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: jbuilder
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.3.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
81
123
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
124
|
+
version: 2.3.1
|
83
125
|
description: Enable active_decorator to automatically decorate associated models
|
84
126
|
email: itkrt2y.591721200@gmail.com
|
85
127
|
executables: []
|
@@ -95,11 +137,17 @@ files:
|
|
95
137
|
- active_decorator_with_decorate_associations.gemspec
|
96
138
|
- bin/console
|
97
139
|
- bin/setup
|
140
|
+
- gemfiles/Gemfile-rails.3.2.x
|
141
|
+
- gemfiles/Gemfile-rails.4.0.x
|
142
|
+
- gemfiles/Gemfile-rails.4.1.x
|
143
|
+
- gemfiles/Gemfile-rails.4.2.x
|
144
|
+
- gemfiles/Gemfile-rails.5.0.0.beta3
|
98
145
|
- lib/active_decorator_with_decorate_associations.rb
|
99
146
|
- lib/active_decorator_with_decorate_associations/active_decorator_extension.rb
|
100
147
|
- lib/active_decorator_with_decorate_associations/association_decorator.rb
|
101
148
|
- lib/active_decorator_with_decorate_associations/collection_association_decorator.rb
|
102
149
|
- lib/active_decorator_with_decorate_associations/decorator.rb
|
150
|
+
- lib/active_decorator_with_decorate_associations/marker.rb
|
103
151
|
- lib/active_decorator_with_decorate_associations/railtie.rb
|
104
152
|
- lib/active_decorator_with_decorate_associations/version.rb
|
105
153
|
homepage: https://github.com/itkrt2y/active_decorator_with_decorate_associations
|
@@ -122,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
170
|
version: '0'
|
123
171
|
requirements: []
|
124
172
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.6.3
|
126
174
|
signing_key:
|
127
175
|
specification_version: 4
|
128
176
|
summary: active_decorator extension to decorate associated models
|