lib/couchrest/model/proxyable.rb in couchrest_model-2.0.1 vs lib/couchrest/model/proxyable.rb in couchrest_model-2.0.3
- old
+ new
@@ -117,9 +117,12 @@
model.#{name}({:proxy => self}.merge(opts))
end
def find_#{name}(*key)
#{name}.key(*key).first()
end
+ def find_#{name}!(*key)
+ find_#{name}(*key) || raise(CouchRest::Model::DocumentNotFound)
+ end
EOS
end
end
end