deckorator 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f870769ae50c5f4571cee9e4a44b438211756c8e
4
- data.tar.gz: a291ca111aec23729d39e1ae8da6f88c60e3501f
3
+ metadata.gz: e3078b1fb68ab78418fe9f6b9c28f577a8a1c556
4
+ data.tar.gz: d77f82ad5c2f69af043b55b8defdd6bc9dfaa1f8
5
5
  SHA512:
6
- metadata.gz: 010af5e16b13e68659d193abc4853de32bbaf21991852efe242455300c33b925222939f53e38493ca4bfb671f9f2e7017ba15b886783733575e5fb94e8cc72fa
7
- data.tar.gz: 65f67f417bc8f6aafaae79b256f1e6cfb6548e09add4b362a812a7fbc7f2d28310371d66d86e0348f026ffe80e67507f041d23c184da8a3ceb1a7360a47559b2
6
+ metadata.gz: 201b1aa1230f26921d2c3e250b6c234efea407af0ebe3cf8de6b688b31ae08e52a5b3de2f0ff6d4af930ce3b4308476063c89ccf0d3ec66241476b1dcc1614bb
7
+ data.tar.gz: 092da84521948181ef688df8c6d05b7c84911cc066bc9311218240ca252b537bd0d041843f1de58131534053c0a1d3274a203b95c60d7d08a6e3db44f282c53e
data/README.md CHANGED
@@ -82,6 +82,16 @@ $ rails g deckorator:decorator user
82
82
 
83
83
  This will create a `UserDecorator` in the `app/decorators` directory while also generating a stubbed test.
84
84
 
85
+ #### Also using Pundit?
86
+
87
+ You might want to add this to your **app/decorators/ApplicationDecorator**:
88
+
89
+ ```rb
90
+ def self.policy_class
91
+ "#{decorated_object_class}Policy"
92
+ end
93
+ ```
94
+
85
95
  ## Related
86
96
 
87
97
  * <https://github.com/drapergem/draper>
@@ -10,6 +10,11 @@ module Deckorator
10
10
  super
11
11
  end
12
12
 
13
+ def to_param
14
+ decorated_object.respond_to?(:to_param) ?
15
+ decorated_object.to_param : super
16
+ end
17
+
13
18
  module ClassMethods
14
19
  def method_missing(method, *args, &block)
15
20
  decorated_object_class.respond_to?(method) ?
@@ -1,3 +1,3 @@
1
1
  module Deckorator
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deckorator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Otander
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-01-04 00:00:00.000000000 Z
12
+ date: 2016-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -131,9 +131,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.4.3
134
+ rubygems_version: 2.4.5.1
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Lightweight decorators using plain old Ruby objects.
138
138
  test_files: []
139
- has_rdoc: