lib/ensurance.rb in ensurance-0.1.7 vs lib/ensurance.rb in ensurance-0.1.8
- old
+ new
@@ -42,9 +42,10 @@
found
end
def ensure!(thing = nil)
+ return nil unless thing.present?
result = self.ensure(thing)
raise ::ActiveRecord::RecordNotFound.new("#{self}[#{thing ? thing : 'nil'}]") unless result
result
end