activeadmin-poro-decorator 0.0.6 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activeadmin-poro-decorator/version.rb +1 -1
- data/lib/activeadmin-poro-decorator.rb +13 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cab839a35f621934c35d5cc4c83d0026bd5051e
|
4
|
+
data.tar.gz: bec39e01c4023a4a1e6aab8c366ee18e045a31c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fbc2eb54dd8e28ab79d0a64b70853adbd1777ca158d8389774ec466514cd7f39ffa8c699b5493a4b35286b7925e2526de51f80c810ab21950a00e622b7376d4
|
7
|
+
data.tar.gz: dd2870915a74aa0506c4ea2ad09850644ca5a4b9175dfc07608c2c32b91dfd07cc19dbc4b7b8b8ce28b872c403bd1b45437561211264fba74e31a9a050e791b5
|
@@ -2,6 +2,16 @@ require 'activeadmin-poro-decorator/version'
|
|
2
2
|
require 'activeadmin-poro-decorator/config'
|
3
3
|
require 'activeadmin-poro-decorator/railtie' if defined?(Rails)
|
4
4
|
|
5
|
+
# monkey patch to make ActiveAdmin::Comment works with activeadmin_poro_decorator
|
6
|
+
module ActiveAdmin
|
7
|
+
class Comment < ActiveRecord::Base
|
8
|
+
# @returns [String] The name of the record to use for the polymorphic relationship
|
9
|
+
def self.resource_type(resource)
|
10
|
+
resource.type
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
5
15
|
module ActiveadminPoroDecorator
|
6
16
|
extend ActiveSupport::Concern
|
7
17
|
|
@@ -17,7 +27,9 @@ module ActiveadminPoroDecorator
|
|
17
27
|
def decorate(*args)
|
18
28
|
collection_or_object = args[0]
|
19
29
|
if collection_or_object.respond_to?(:to_ary)
|
20
|
-
|
30
|
+
# assuming we have self.model_name method in decorator implementation
|
31
|
+
# suggested by @eyefodder
|
32
|
+
class_name = model_name.to_s.constantize
|
21
33
|
DecoratedEnumerableProxy.new(collection_or_object, class_name)
|
22
34
|
else
|
23
35
|
new(collection_or_object)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-poro-decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krivich Ekaterina
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|