views:

27

answers:

1

So I'm trying to rough out a design in Ruby, and so I ran

ruby script/generate scaffold item name:string description:text model:string manufacturers_name:string category:string weight:decimal upc:string ebay_cat_id:string blacklist:bool in_discovery:bool archived:bool

The only problem is that none of the bool fields are on the model. If I use ruby script/consol and run

item = Item.new

I get

#<Item id: nil, name: nil, description: nil, model: nil, manufacturers_name: nil, category: nil, weight: nil, upc: nil, ebay_cat_id: nil, created_at: nil, updated_at: nil>

Is there a limit to how many fields it will show on the object? I know the fields were created in the database... double checked that.

Come to think of it the date timestamps aren't on the object either. Any hints for me? Do I have to manually write accessors for these or what?

+2  A: 

Have you tried:

blacklist:boolean

It looks like you must declare the full name, the docs say:

Instantiates a new column for the table. The type parameter is normally one of the migrations native types, which is one of the following: :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean.

Just like you cannot use int, you must declare integer

To answer the second part of your question, Yes! there is a limit to the number of columns you may have, 4096.

It's likley that once the interpreter hit "bool" it nixed the latter column names and types, that is why you're probably missing your timestamps and what not.

Joseph Silvashy
Thanks... guess I just missed that. Thanks again.
Boushley
It seems weird to me that it just dies silently... Or are there logs somewhere I'm just not checking?
Boushley