lib/mongoid-dsl/monkey.rb in mongoid-dsl-1.4.0 vs lib/mongoid-dsl/monkey.rb in mongoid-dsl-1.4.1
- old
+ new
@@ -570,10 +570,10 @@
when ![ ::Symbol, ::String].select{ |klass|self.class <= klass }.empty?
Mongoid.models.each do |model_name|
mongoid_model_name= model_name.mongoid_name
if [mongoid_model_name,mongoid_model_name+'s'].any?{|mn| self.to_s == mn }
- return model_name.to_s.constantize
+ return model_name
end
end
return self.to_s.split('::').last.underscore
\ No newline at end of file