Skip to content

Commit

Permalink
Ability to call Model.for with class constant
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrj committed Jun 14, 2011
1 parent 6b8bedd commit 4303506
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/administer/model.rb
Expand Up @@ -17,7 +17,8 @@ def all
end

def for(model_name)
Model.new(lookup(model_name))
klass = model_name.is_a?(Class) ? model_name : lookup(model_name)
Model.new(klass)
end

private
Expand Down

0 comments on commit 4303506

Please sign in to comment.