Skip to content

Commit

Permalink
yml file changed
Browse files Browse the repository at this point in the history
  • Loading branch information
kiote committed Nov 26, 2014
1 parent 454ff8e commit 01835e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions activeadmin-poro-decorator.yml.example
@@ -0,0 +1,2 @@
modelname: Decorator
use_helpers: true
3 changes: 2 additions & 1 deletion lib/activeadmin-poro-decorator.rb
Expand Up @@ -41,7 +41,8 @@ def initialize(collection, class_name)
end

def klass
"#{@class_name}Decorator".constantize
config = Config::Reader.new
"#{@class_name}#{config['modelname']}".constantize
end

def wrapped_collection
Expand Down
6 changes: 1 addition & 5 deletions lib/activeadmin-poro-decorator/config.rb
Expand Up @@ -4,12 +4,8 @@ module ActiveadminPoroDecorator
module Config
class Reader
def initialize
@config = YAML.load_file('activeadmin-poro-decorator.yml.example')
@config = YAML.load_file('activeadmin-poro-decorator.yml')
end
end

def read(option)
@config[option]
end
end
end

0 comments on commit 01835e7

Please sign in to comment.