lib/ez/schema_modifier.rb in ez-0.6.5 vs lib/ez/schema_modifier.rb in ez-0.7.0

- old
+ new

@@ -60,10 +60,12 @@ display_change "Changing column type for '#{col_name}' to #{col_type}" db.change_column(table_name, col_name.to_sym, col_type.to_sym) end else display_change "Adding new column '#{col_name}' as #{col_type} for model #{model_name}" + options = {} + options[:default] = false if col_type.to_sym == :boolean db.add_column(table_name, col_name.to_sym, col_type.to_sym) end end end @@ -73,10 +75,12 @@ ActiveRecord::Schema.define do create_table table_name do |t| columns.each do |column| name = column.keys.first col_type = column[name] - t.send(col_type, name) + options = {} + options[:default] = false if col_type.to_sym == :boolean + t.send(col_type, name, options) end # t.timestamps end end filename = "app/models/#{model_name.underscore}.rb"