Skip to content

Commit

Permalink
Merge 0c3250c into f919c03
Browse files Browse the repository at this point in the history
  • Loading branch information
patleb committed Aug 29, 2016
2 parents f919c03 + 0c3250c commit 3d5adcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/rails_admin/abstract_model.rb
Expand Up @@ -20,7 +20,9 @@ def new(m)
m = m.constantize unless m.is_a?(Class)
(am = old_new(m)).model && am.adapter ? am : nil
rescue LoadError, NameError
puts "[RailsAdmin] Could not load model #{m}, assuming model is non existing. (#{$ERROR_INFO})" unless Rails.env.test?
unless Rails.env.test? || m.to_s.try(:start_with?, '#<Class:0x')
puts "[RailsAdmin] Could not load model #{m}, assuming model is non existing. (#{$ERROR_INFO})"
end
nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rails_admin/config.rb
Expand Up @@ -225,7 +225,7 @@ def model(entity, &block)
if entity.is_a?(RailsAdmin::AbstractModel)
entity.model.try(:name).try :to_sym
elsif entity.is_a?(Class)
entity.name.to_sym
entity.name.try :to_sym
elsif entity.is_a?(String) || entity.is_a?(Symbol)
entity.to_sym
else
Expand Down

0 comments on commit 3d5adcf

Please sign in to comment.