Wrong number of arguments (2 of 0)


#1

I’m new with RoR.
I have a simple migration file:
class CreateClubs < ActiveRecord::Migration
def self.up
create_table :clubs do |t|
t.columns :name, :string
t.columns :ref, :string
t.columns :description, :string
t.columns :local, :string

  t.timestamps
end

end

def self.down
drop_table :clubs
end
end

But I get this error message:

[…]
Wrong number of arguments (2 of 0)
./db/[…].rb:4:in ‘columns’
[…]

What am I missing?
Thank you for your help.


#2

Juste before trying to migrate thie table clubs, I did it fine with
league:

class CreateLeagues < ActiveRecord::Migration
def self.up
create_table :leagues do |t|
t.columns :name, :string
t.columns :ref, :string
t.columns :description, :string
t.columns :category, :string

  t.timestamps
end

end

def self.down
drop_table :leagues
end
end


#3

On Oct 24, 2008, at 9:40 AM, Thierry D. wrote:

 t.columns :category, :string

Shouldn’t that be “t.column”? (no ‘s’). Or maybe even…

t.string :name