This project is archived and is in readonly mode.

#1129 ✓invalid
Ryan Bigg

Namespaced models with Counter Cache

Reported by Ryan Bigg | September 28th, 2008 @ 12:17 PM | in 2.x

Close this ticket, it is fixed in Edge rails.

Comments and changes to this ticket

  • Ryan Bigg

    Ryan Bigg September 28th, 2008 @ 12:19 PM

    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

    Pratik January 18th, 2009 @ 05:56 AM

    • State changed from “new” to “invalid”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages