Đây là di cư ban đầu của tôi:ray db di cư, phương pháp xác định 'to_sym', không thể tìm ra cú pháp
class CreateUsers < ActiveRecord::Migration
def self.up
ActiveRecord::Base.transaction do
create_table "users", :force => true do |t|
t.string :login, :limit => 40
t.string :name, :limit => 100, :default => '', :null => true
t.string :email, :limit => 100
t.string :crypted_password, :limit => 40
t.string :salt, :limit => 40
t.string :remember_token, :limit => 40
t.datetime :remember_token_expires_at
t.string :activation_code, :limit => 40
t.datetime :activated_at, :datetime
t.string :state, :null => :no, :default => 'passive'
t.datetime :deleted_at
t.integer :occupation_id, :null => :yes
t.datetime :paid_up_to_date, :date
t.timestamps
end
Tôi cố gắng để thay đổi mặc định của 'nhà nước' là 'tích cực' thay vì thụ động Đây là nỗ lực thứ hai của tôi;
class ChangeUserStateDefault < ActiveRecord::Migration
def self.up
change_column :users, :state, :null => :no, :default => 'active'
end
bài viết toàn bộ lỗi: phần mà đến trước và sau khi "phương pháp xác định". Câu hỏi đặt ra là lớp/đối tượng nào đang tăng lỗi đó? –
== ChangeUserStateDefault: di chuyển ========================================= - change_column (: người dùng,: state, {: default => "active",: null =>: no}) rake hủy bỏ! Đã xảy ra lỗi, việc di chuyển này và tất cả sau này bị hủy: phương thức chưa xác định 'to_sym 'cho {: default =>" active ",: null =>: no}: Hash – sysconfig