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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2e73fd4d6a07dc0d7ff63764aa2b8cd1bb09bd3
4
- data.tar.gz: 6d7bf59e448c139b4974d45319b97325bb3d99c8
3
+ metadata.gz: 0cab839a35f621934c35d5cc4c83d0026bd5051e
4
+ data.tar.gz: bec39e01c4023a4a1e6aab8c366ee18e045a31c7
5
5
  SHA512:
6
- metadata.gz: f53cbc08c0fbf72ae9fa01169630d0dfa2f73527ba3cd891aa7aa6564b708ff3e5da0f418fcdd8ea72232cf046d4701e787de5b6a10f61efc3f413ce503bc101
7
- data.tar.gz: d7e2f3ed30e999c0c17ba28d46d61dc8300799a4069224840e72e963c49111e75cdd0e69fc2250fc5064076674184daae295db8a727e6153207044887f74832b
6
+ metadata.gz: 8fbc2eb54dd8e28ab79d0a64b70853adbd1777ca158d8389774ec466514cd7f39ffa8c699b5493a4b35286b7925e2526de51f80c810ab21950a00e622b7376d4
7
+ data.tar.gz: dd2870915a74aa0506c4ea2ad09850644ca5a4b9175dfc07608c2c32b91dfd07cc19dbc4b7b8b8ce28b872c403bd1b45437561211264fba74e31a9a050e791b5
@@ -1,3 +1,3 @@
1
1
  module ActiveadminPoroDecorator
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -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
- class_name = collection_or_object.class.to_s.demodulize.gsub('ActiveRecord_Relation_', '')
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.6
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-09 00:00:00.000000000 Z
11
+ date: 2014-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler