Merge pull request #2054 from ligthyear/fix-broken-cats

BugFix: email-in on categories wasn't null-ed properly
This commit is contained in:
Sam 2014-03-05 11:16:20 +11:00
commit b0fc834e09

View File

@ -60,6 +60,10 @@ class CategoriesController < ApplicationController
if category_params[:position]
category_params[:position] == 'default' ? cat.use_default_position : cat.move_to(category_params[:position].to_i)
end
if category_params.key? :email_in and category_params[:email_in].length == 0
# properly null the value so the database constrain doesn't catch us
category_params[:email_in] = nil
end
category_params.delete(:position)
cat.update_attributes(category_params)
}