Checking for block given and ensuring proyxable finds classes in root namespace

This commit is contained in:
Sam Lown 2011-03-13 13:39:26 +01:00
parent f58482553c
commit d1baf99324
5 changed files with 24 additions and 2 deletions

View file

@ -27,7 +27,7 @@ module CouchRest
mapper = DesignMapper.new(self)
mapper.create_view_method(:all)
mapper.instance_eval(&block)
mapper.instance_eval(&block) if block_given?
req_design_doc_refresh
end

View file

@ -20,7 +20,7 @@ module CouchRest
unless respond_to?('#{db_method}')
raise "Missing ##{db_method} method for proxy"
end
@#{model_name} ||= CouchRest::Model::Proxyable::ModelProxy.new(#{options[:class_name]}, self, self.class.to_s.underscore, #{db_method})
@#{model_name} ||= CouchRest::Model::Proxyable::ModelProxy.new(::#{options[:class_name]}, self, self.class.to_s.underscore, #{db_method})
end
EOS
end