Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Namespaced models with Counter Cache

#1129

Close this ticket, it is fixed in Edge rails.

Reported by Ryan Bigg · September 28th, 2008 @ 12:17 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Ryan Bigg
    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.

    September 28th, 2008 @ 12:19 PM

  2. Pratik
    Pratik
    • State changed from new to invalid

    January 18th, 2009 @ 05:56 AM