Checking for block given and ensuring proyxable finds classes in root namespace
This commit is contained in:
parent
f58482553c
commit
d1baf99324
5 changed files with 24 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue