我有以下迁移:
class CreateTariffs < ActiveRecord::Migration
def change
create_table :tariffs do |t|
t.string :name
t.decimal :amount, precision: 10, scale: 6, default: 0.0
t.timestamps
end
end
end
我的迁移失败,但出现以下异常:
undefined method `sql_type' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ColumnDefinition:0x000000089a4108>/home/polygalin/.rvm/gems/ruby-2.0.0-p195/gems/activerecord-postgres-array-0.0.9/lib/activerecord-postgres-array/activerecord.rb:42:in `quote_with_array'
但是,如果我删除“金额”列的默认值,迁移成功。任何人都可以帮助找出为什么迁移失败并使用小数列的默认值?