lib/pardner/base.rb in pardner-0.1.1 vs lib/pardner/base.rb in pardner-0.1.2
- old
+ new
@@ -85,11 +85,14 @@
end
def save
valid? or return false
- status = ActiveRecord::Base.transaction do
- run_callbacks(:save) { super }
+ status = nil
+
+ ActiveRecord::Base.transaction do
+ status = run_callbacks(:save) { super }
+ status or raise ActiveRecord::Rollback
end
status == true
end