This project is archived and is in readonly mode.
undefined method `quoted_table_name' with model called "schema"
-
CancelProfileIsBroken
- Tag changed from nomethoderror, quoted_table_name, schema to bugmash, nomethoderror, quoted_table_name, schema
-
Nikolay Petrachkov
"verified" with instructions above.
Same error with MySQL and PostgreSQL.
/home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/migration.rb:352:in `block in method_missing' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/migration.rb:328:in `block in say_with_time' /usr/local/lib/ruby/1.9.1/benchmark.rb:294:in `measure' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/migration.rb:328:in `say_with_time' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/migration.rb:348:in `method_missing' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/reflection.rb:187:in `quoted_table_name' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb:86:in `construct_sql' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:21:in `initialize' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/associations.rb:1265:in `new' /home/jastix/projects/bugmash/2048/schem/vendor/rails/activerecord/lib/active_record/associations.rb:1265:in `block in collection_reader_method' (eval):3:in `destroy_without_callbacks' /home/jastix/projects/bugmash/2048/schem/app/controllers/plans_controller.rb:62:in `destroy'
-
Dan Pickett
not reproducible
I was able to create a new rails app with a schema model and a user model - upon creating and destroying a user I did not get any errors
-
Dmitry Ratnikov
+1
Behavior verified on 2-3-stable.
-
Dmitry Ratnikov
-1 The error stems from a reflection instance returning ActiveRecord::Schema (rather than regular Schema) as klass.
As a work around, use:
class User < ActiveRecord::Base
has_and_belongs_to_many :schemas, :class_name => "::Schema" end -
Rizwan Reza
not reproducible
-1 It is evident that ActiveRecord will have problems with tables that have matching names to its internal classes.
-
CancelProfileIsBroken
- State changed from new to invalid
- Tag changed from bugmash, nomethoderror, quoted_table_name, schema to nomethoderror, quoted_table_name, schema
