Chris Anderson
2007-Oct-18 04:55 UTC
patch for token generator throttling inserts to 1/sec
Because the new simplified ActiveRecord::Base#inspect no longer includes the memory offset, a series of ActiveRecord objects created (without attributes) in quick succession will have the same inspect value. This makes #inspect insufficient for generating unique tokens. In practice, this means creation of token_generator objects involves running as many select queries as the server can handle for one second, then making the insert, and running selects again... repeat. The fix is simple and included in the patch here: http://dev.rubyonrails.org/ticket/9622 I''ve got two +1s on this patch, and just need another before it can be applied. Thanks anyone especially if you use the token_generator plugin on trunk rails! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
+1 verified :) On Oct 17, 9:55 pm, Chris Anderson <jch...@gmail.com> wrote:> Because the new simplified ActiveRecord::Base#inspect no longer > includes the memory offset, a series of ActiveRecord objects created > (without attributes) in quick succession will have the same inspect > value. > > This makes #inspect insufficient for generating unique tokens. In > practice, this means creation of token_generator objects involves > running as many select queries as the server can handle for one > second, then making the insert, and running selects again... repeat. > > The fix is simple and included in the patch here:http://dev.rubyonrails.org/ticket/9622 > > I''ve got two +1s on this patch, and just need another before it can be > applied. > > Thanks anyone especially if you use the token_generator plugin on > trunk rails!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---