lib/classy-inheritance.rb in johnsbrn-classy-inheritance-0.6.8.1 vs lib/classy-inheritance.rb in johnsbrn-classy-inheritance-0.6.8.2

- old
+ new

@@ -63,11 +63,11 @@ end end module Stonean module ClassyInheritance - VERSION = '0.6.8.1' + VERSION = '0.6.8.2' def self.version VERSION end @@ -134,11 +134,11 @@ # Adds a find_with_<model_sym> class method define_find_with_method(model_sym) if options[:as] - define_can_be_method_on_requisite_class(options[:class_name] || model_sym, options[:as]) + define_can_be_method_on_requisite_class(options[:class_name] || model_sym.to_s.classify, options[:as]) end options[:attrs].each{|attr| define_accessors(model_sym, attr, options)} end @@ -261,10 +261,10 @@ eval("self.#{model_sym}.#{attr}= val") end end def define_can_be_method_on_requisite_class(model_sym, polymorphic_name) - klass = model_sym.to_s.classify + klass = model_sym.to_s requisite_klass = eval(klass) unless requisite_klass.respond_to?(self.name.underscore.to_sym) requisite_klass.send :can_be, self.name.underscore, :as => polymorphic_name end