I have this model

class User < Sequel::Model(:users)
   one_to_many :ftp_logs
end

this migration file

class AddNewUser < Sequel::Migration
  def up
    create_table :users do
       primary_key :id
       varchar :username
       varchar :password
    end
  end
  def down
    drop_table :users
  end
end

class CreateAdmin < Sequel::Migration
  def up
    password = myhelper.rndstr 8
    User.create(:username => "admin", :password => password)
    puts "your admin password is : " + password
  end
  def down
    user = User[:username => "admin"]
    user.destroy
  end
end

My problem is the CreateAdmin will raise error on User.create saying
that method username= doesn't exist or access is restricted to it.

But when I check the column before create, with something like this

User.columns == [:id, :username, :password]

or just print out the column with

puts User.columns

right before create. The migration will be succeed...

is there something I miss? or is that a bug?

thanks...

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to