This project is archived and is in readonly mode.
Namespaced models with Counter Cache
-
Ryan Bigg
A stack trace would be nice I suppose:
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: logga/chats_count: UPDATE "chats" SET "logga/chats_count" = COALESCE("logga/chats_count", 0) + 1 WHERE ("id" = 1)
from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract_adapter.rb:147:in `log' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/sqlite_adapter.rb:132:in `execute' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/sqlite_adapter.rb:372:in `catch_schema_changes' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/sqlite_adapter.rb:132:in `execute' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:167:in `update_sql' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/sqlite_adapter.rb:136:in `update_sql' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:49:in `update_without_query_dirty' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `update' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:752:in `update_all' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:837:in `update_counters_without_lock' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/locking/optimistic.rb:143:in `update_counters' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:856:in `increment_counter' from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.1/lib/active_record/associations.rb:928:in `belongs_to_counter_cache_after_create_for_person'That last line is where it is erroring, the line in question is:
"#{self.to_s.underscore.pluralize}_count" :where self is the model class e.g. Logga::Chat. -
Pratik
- State changed from new to invalid