Open ghanshyamdrathod opened 14 years ago
Me too. The problem is the line that begins: insert_sql = ActiveRecord::Base.send(:sanitize_sql, [
SQL queries seem no longer allowed on ActiveRecord::Base - you need to find an actual Active Record subclass because otherwise "abstract_class?" isn't yet defined... stupid really, ActiveRecord::Base#abstract_class? should exist and return true...
I've solved it with a horrible monkey-patch:
class Object
# ActiveRecord::Base *is* an abstract class.
unless defined?(abstract_class?)
def abstract_class?
true
end
end
end
taryneast monkey-patch originally worked for us - but it also broke the ability to use model finds in migrations. SomeModel.find(:all) fails with: SELECT * FROM bases
Hi I am using desert gem with community-engine plugin and tried to run rake db:migrate . i got following errors on the server.
rake aborted! undefined method
abstract_class?' for Object:Class /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2207:in
class_of_active_record_descendant' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1462:inbase_class' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1138:in
reset_table_name' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1134:intable_name' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:3113:in
quoted_table_name' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2226:insanitize_sql' /usr/local/lib/ruby/gems/1.8/gems/desert-0.5.3/lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb:23:in
send' /usr/local/lib/ruby/gems/1.8/gems/desert-0.5.3/lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb:23:ininitialize_schema_migrations_table' /usr/local/lib/ruby/gems/1.8/gems/desert-0.5.3/lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb:22:in
each' /usr/local/lib/ruby/gems/1.8/gems/desert-0.5.3/lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb:22:ininitialize_schema_migrations_table' /usr/local/lib/ruby/gems/1.8/gems/desert-0.5.3/lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb:11:in
each' /usr/local/lib/ruby/gems/1.8/gems/desert-0.5.3/lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb:11:ininitialize_schema_migrations_table' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:436:in
initialize' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:400:innew' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:400:in
up' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:383:inmigrate' /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:116 /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
call' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:inexecute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:inexecute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
invoke_with_call_chain' /usr/local/lib/ruby/1.8/monitor.rb:242:insynchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
invoke_with_call_chain' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:ininvoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
invoke_task' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:intop_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
standard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:intop_level' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in
run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:instandard_exception_handling' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in
run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /usr/local/bin/rake:19:in `load' /usr/local/bin/rake:19