Displaying 5 results from an estimated 5 matches for "decrement_count".
Did you mean:
decrement_counter
2006 Feb 27
0
Better counter_caches
Hey everybody,
Rails currently offers ''belongs_to :counter_cache'', which is a very
basic replacement for count triggers:
":counter_cache - caches the number of belonging objects on the
associate class through use of increment_counter and decrement_counter.
The counter cache is incremented when an object of this class is created
and decremented when it?s destroyed. This requires that a column named
"#{table_name}_count" (such as comments_count for a belonging Comment
class) is used on the associate class (such as a Post class)."...
2006 Mar 24
6
Should counter_cache fields be saved in the database?
As far as I can tell, the counter_cache option on a belongs_to model
doesn''t actually save anything in the database. For example, I have
the following models:
class Parent < ActiveRecord::Base
has_many :children,
:conditions => "deleted_at IS NULL"
end
class Child < ActiveRecord::Base
belongs_to :parent, :counter_cache => true
end
With the following
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2004 Oct 25
1
Rails 0.8: Just shy of 100 additions, changes, tweaks, and fixes!
...entries in the has_and_belongs_to_many join table didn''t
get removed when an associated object was destroyed.
* Fixed unnecessary calls to SET AUTOCOMMIT=0/1 for MySQL adapter
[Andreas Schwarz]
* Fixed PostgreSQL defaults are now handled gracefully [Dave Steinberg]
* Fixed increment/decrement_counter are now atomic updates [Andreas
Schwarz]
* Fixed the problems the Inflector had turning Attachment into
attuchments and Cases into Casis [radsaq/Florian Gross]
* Fixed that cloned records would point attribute references on the
parent object [Andreas Schwarz]
* Fixed SQL for type call on...
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
...9;'
./test/../lib/active_record/base.rb:685:in `update_all''
./test/../lib/active_record/base.rb:771:in `update_counters_without_lock''
./test/../lib/active_record/locking/optimistic.rb:139:in `update_counters''
./test/../lib/active_record/base.rb:807:in `decrement_counter''
./test/../lib/active_record/callbacks.rb:309:in `callback''
./test/../lib/active_record/callbacks.rb:309:in `callback''
./test/../lib/active_record/callbacks.rb:304:in `each''
./test/../lib/active_record/callbacks.rb:304:in `callback''...