I have some boolean attributes in the Rails 3.1 model, and two new ones that I just added through migration do not work properly on Heroku (Cedar). They work correctly locally, where I also use PostgreSQL (version 9).
Migration:
class AddNotificationSettingsToCollections < ActiveRecord::Migration def change add_column :collections, :email_comments, :boolean , :default => true add_column :collections, :email_selections, :boolean , :default => true end end
View (HAML)
%li %label{:for => 'collection_email_comments'} = f.check_box :email_comments Email me when comments are made %li %label{:for => 'collection_email_selections'} = f.check_box :email_selections Email me when a selection is made
The problem is that this flag is ALWAYS displayed as unchecked, but with the ALWAYS validation model, attributes set to true are validated. When I close the Heroku log file, I see that the correct parameter is set for these fields (1).
Am I missing something? I have other Boolean fields in this form that work fine. Could this be due to the default?
source share