Setting boolean field in before_create stops creation?
ruby-on-rails, ruby-on-rails-3
Solution
If you set `active = false` at the end of your `before_create` filter, the filter will return `false` and halt the filter execution chain, cause the save not to complete.
If this is the case in your code, just return `true` at the end of your `before_create` and you should be fine.
Problem
So this may have been a mistake. In my model, on my `orders` table, I have a field named `active`. Its a boolean value and defaults to true. In a `before_create` on orders, I'm doing some logic that will set `active` to false if XYZ occurs. When XYZ happens though, it seems to stop the record from being saved all together (without providing me any real errors), rather than just the field being set as false. Any ideas?