lib/restful_resource/base.rb in restful_resource-0.0.8 vs lib/restful_resource/base.rb in restful_resource-0.0.9

- old
+ new

@@ -31,21 +31,21 @@ end def self.has_one(nested_resource_type) klass = nested_resource_type.to_s.camelize.safe_constantize - klass = OpenStruct if (klass.nil? || klass.superclass != RestResource) + klass = OpenStruct if (klass.nil? || klass.superclass != RestfulResource) self.send(:define_method, nested_resource_type) do nested_resource = @inner_object.send(nested_resource_type) return nil if nested_resource.nil? klass.new(@inner_object.send(nested_resource_type)) end end def self.has_many(nested_resource_type) klass = nested_resource_type.to_s.singularize.camelize.safe_constantize - klass = OpenStruct if (klass.nil? || (klass.superclass != RestResource)) + klass = OpenStruct if (klass.nil? || (klass.superclass != RestfulResource)) self.send(:define_method, nested_resource_type) do @inner_object.send(nested_resource_type).map { |obj| klass.new(obj) } end end