activeadmin-poro-decorator 0.0.2 → 0.0.3

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: 205e0292c9de856479a602d2614bd6bcf34bccd8
4
- data.tar.gz: 313c729a50491886d17fdc503f13aedc17dab638
3
+ metadata.gz: 062fc917857ffe5237e7f2181fc833efe04c0c7e
4
+ data.tar.gz: ee6263f3ec74786489cdded3c7ed105f77148001
5
5
  SHA512:
6
- metadata.gz: 8094bb66b7e7dcf04e710e631a9ac881c2f4ef76e45ca128cf5a83301581245c2536d1cb610184d186ad4a4af3d4cd46c4e889e91c987d81f2f6f47b48e705e8
7
- data.tar.gz: ae48c621199a707a9402e273b95876d4def30953578f32ef8d23f97a7bbeb269f7fe2ee5623b8a4b064690fb206b691f5dceaa88fcdbffe449bafaa7e62bac65
6
+ metadata.gz: fab7bc34263caf9f0db16e492a23e2ea85f874b0070fb4f858ea054ad9d31a8c03dad66e1dcb21e66c5a9fcf042330ac530d22c1cc5f851c3af3003c6fcbc314
7
+ data.tar.gz: b377a8fd655c5e2a5507567c435e96d640c7783e65aa7af88e540a868e794db705f6773ecd70e6d824a67489955ef4262ed58e2077b0d59b5175f992c17fa47a
@@ -0,0 +1,2 @@
1
+ modelname: Decorator
2
+ use_helpers: true
@@ -2,6 +2,8 @@ require 'activeadmin-poro-decorator/version'
2
2
  require 'activeadmin-poro-decorator/config'
3
3
 
4
4
  module ActiveadminPoroDecorator
5
+ require 'activeadmin-poro-decorator/railtie' if defined?(Rails)
6
+
5
7
  extend ActiveSupport::Concern
6
8
 
7
9
  def helpers
@@ -39,7 +41,8 @@ module ActiveadminPoroDecorator
39
41
  end
40
42
 
41
43
  def klass
42
- "#{@class_name}Decorator".constantize
44
+ config = Config::Reader.new
45
+ "#{@class_name}#{config.param('modelname')}".constantize
43
46
  end
44
47
 
45
48
  def wrapped_collection
@@ -4,12 +4,12 @@ module ActiveadminPoroDecorator
4
4
  module Config
5
5
  class Reader
6
6
  def initialize
7
- @config = YAML.load_file('activeadmin-poro-decorator.yml.example')
7
+ @config = YAML.load_file('config/activeadmin-poro-decorator.yml')
8
8
  end
9
- end
10
9
 
11
- def read(option)
12
- @config[option]
10
+ def param(name)
11
+ @config[name]
12
+ end
13
13
  end
14
14
  end
15
15
  end
@@ -0,0 +1,11 @@
1
+ require 'activeadmin-poro-decorator'
2
+ require 'rails'
3
+ module ActiveAdminPoroDecorator
4
+ class Railtie < Rails::Railtie
5
+ railtie_name :activeadmin_poro_decorator
6
+
7
+ rake_tasks do
8
+ load "tasks/copy_config.rake"
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveadminPoroDecorator
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-poro-decorator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krivich Ekaterina
@@ -67,10 +67,12 @@ files:
67
67
  - README.md
68
68
  - Rakefile
69
69
  - activeadmin-poro-decorator-0.0.1.gem
70
+ - activeadmin-poro-decorator-0.0.2.gem
70
71
  - activeadmin-poro-decorator.gemspec
71
72
  - activeadmin-poro-decorator.yml.example
72
73
  - lib/activeadmin-poro-decorator.rb
73
74
  - lib/activeadmin-poro-decorator/config.rb
75
+ - lib/activeadmin-poro-decorator/railtie.rb
74
76
  - lib/activeadmin-poro-decorator/version.rb
75
77
  - lib/tasks/copy_config.rake
76
78
  - spec/spec_helper.rb