lib/zertico/accessor.rb in zertico-0.5.3 vs lib/zertico/accessor.rb in zertico-0.5.4
- old
+ new
@@ -25,21 +25,25 @@
end
protected
def self.interface_name
- self.name.chomp('Accessor').singularize.underscore
+ self.interface_class.name.singularize.underscore
end
- def interface_name
- self.class.name.chomp('Accessor').singularize.underscore
+ def self.interface_class
+ begin
+ self.name.chomp('Accessor').constantize
+ rescue NameError
+ self.name.chomp('Accessor').split('::').last.constantize
+ end
end
- def self.interface_class
- self.interface_name.camelize.constantize
+ def interface_name
+ self.class.interface_name
end
def interface_class
- self.interface_name.camelize.constantize
+ self.class.interface_class
end
end
end
\ No newline at end of file