Problem scaffolding using "namespace"

Hello,

When executing “ruby script/generate model Namespace::Person” the
script create (as expected) “./models/namespace/person.rb”. Also a
migration file is created.

When executing “ruby script/generate controller Namespace::Person” the
script create (as expected) “./controllers/namespace/person.rb”.

But when I execute “ruby script/generate scaffold Namespace::Person
Namespace::Person” the script create “./models/person.rb” and got an
error “Before updating scaffolding from new DB schema, try creating a
table for your model (Namespace::Person)”. My table exist in the
database. I created it using the migration file created from the first
script call. Also the controller is not created.

Any ideas ?

Regards,

Sacha

Hello,

Here an other strange issue probably related:

When executing “ruby script/generate model Namespace::Person” the
script create (as expected) “./models/namespace/person.rb”. Also a
migration file is created. The migration file create a table named
“namespace_people”.

I I run the console and try to create a new instance of
“Namespace::Person” I get an exception:

ns = Namespace::Person.new
ns = Namespace::Person.new

ActiveRecord::StatementInvalid: Mysql::Error: #42S02Table
‘testdocument_development.people’ doesn’t exist: SHOW FIELDS FROM
people

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/connection_adapters/abstract_adapter.rb:128:in `log’

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/connection_adapters/mysql_adapter.rb:243:in `execute’

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/connection_adapters/mysql_adapter.rb:348:in `columns’

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/base.rb:763:in `columns’

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/base.rb:2060:in
`attributes_from_column_definition_without_lock’

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/locking/optimistic.rb:45:in
`attributes_from_column_definition’

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/base.rb:1502:in `initialize_without_callbacks’

    from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/

active_record/callbacks.rb:225:in `initialize’

    from (irb):1:in `new'

    from (irb):1

On Aug 31, 2:39 pm, “[email protected]

Hi,

Adding "set_table_name “namespace_people” in my model fix the problem
I get in the console. But scaffolding is still a issue.

Thanks for any idea.

On Aug 31, 2:44 pm, “[email protected]