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.

Array support to update_counters

#1254

Many times I found my self needing to increment a lot of counters at the same time, but it's not possible yet.

Now we can do:

Model.increment_counter :points, [1, 2, 3] Model.decrement_counter :points, [1, 2, 3] Model.update_counters [1, 2, 3], :points => 1

Reported by Carlos Júnior (xjunior) · October 23rd, 2008 @ 12:46 AM

State: resolved
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Carlos Júnior (xjunior)
    Carlos Júnior (xjunior)
    • Title changed from Adding Array support to update_counters to [PATCH] Array support to update_counters

    October 28th, 2008 @ 02:12 PM

  2. José Valim
    José Valim

    +1 Just some tests needed!

    October 29th, 2008 @ 01:42 PM

  3. Carlos Júnior (xjunior)
  4. Pratik
    Pratik
    • Tag changed from 2.2, activerecord, counters, counter_cache to 2.2, activerecord, counters, counter_cache, patch
    • Milestone cleared.
    • Assigned user set to Pratik

    January 19th, 2009 @ 08:12 PM

  5. Pratik
    Pratik
    • Title changed from [PATCH] Array support to update_counters to Array support to update_counters

    January 19th, 2009 @ 08:12 PM

  6. Repository
    Repository
    • State changed from new to resolved

    (from [74871961eccdb455f18e8ef66716041f2f828ba8]) Add array id support to Model.update_counters. [#1254 Array support to update_counters state:resolved] [Carlos Júnior] http://github.com/rails/rails/co...

    January 28th, 2009 @ 08:01 PM