lib/zertico/service.rb in zertico-0.1.0 vs lib/zertico/service.rb in zertico-0.1.1

- old
+ new

@@ -15,24 +15,24 @@ def generate(attributes = {}) { interface_name.to_sym => interface_class.create(attributes) } end def modify(id, attributes = {}) - object = self.find(id) + object = self.find(id)[interface_name.to_sym] object.update_attributes(attributes) { interface_name.to_sym => object } end def delete(id) - object = self.find(id) + object = self.find(id)[interface_name.to_sym] object.destroy { interface_name.to_sym => object } end protected def interface_name - self.name.chomp("Service").underscore + self.class.name.chomp("Controller").singularize.underscore end def interface_class self.interface_name.constantize end \ No newline at end of file