David Heinemeier Hansson
2005-Apr-19 23:43 UTC
[ANN] Rails 0.12.1: No major update without a bit of pain
There''s nothing like pushing a new major update in order to find bugs in the code when its exposed to a couple of hundred working applications. Thankfully the fixes were almost as swift as the reports. In any case, you''ll _definitely_ want to upgrade to 0.12.1 right away. There''s a good handful of fixes for both Action Pack and Active Record (mostly concerning the new eager loading). Here''s the dirt, so you don''t have to go look it up. First for Action Pack: * Added xml_http_request/xhr method for simulating XMLHttpRequest in functional tests #1151 [Sam Stephenson]. Example: xhr :post, :index * Fixed that Ajax.Base.options.asynchronous wasn''t being respected in Ajax.Request (thanks Jon Casey) * Fixed that :get, :post, and the others should take a flash array as the third argument just like process #1144 [rails-l0cZ0mwnNJulQ9BUahrlcQ@public.gmane.org] * Fixed a problem with Flash.now * Fixed stringification on all assigned hashes. The sacrifice is that assigns[:person] won''t work in testing. Instead assigns["person"] or assigns(:person) must be used. In other words, the keys of assigns stay strings but we''ve added a method-based accessor to appease the need for symbols. * Fixed that rendering a template would require a connection to the database #1146 Then for Active Record: * Fixed frivilous database queries being triggered with eager loading on empty associations and other things * Fixed order of loading in eager associations * Fixed stray comma when using eager loading and ordering together from has_many associations #1143 Updating, as always, couldn''t be easier than gem install rails --include-dependencies -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://www.loudthinking.com/ -- Broadcasting Brain
Jeremy Huffman
2005-Apr-19 23:50 UTC
Re: [ANN] Rails 0.12.1: No major update without a bit of pain
Is there any way to eager load an acts_as_tree structure? I looked at acts_as_nested_set but I think in my case I wouldn''t benefit since my users are just as likely to update members as they are to retrieve them (I''m not using this for a message board). This is probably a pretty ignorant question since I cannot think of a way to do this in SQL without sending a procedural batch. If I think I''m a little more likely to read my tree than update it would I still benefit from a nested set? I think it would possible to generate a procedural batch to eager load an acts_as_tree structure but would most applications (other than mine) find this useful? I know many people using Rails use MySQL and I''m not sure it can do this? David Heinemeier Hansson wrote:> There''s nothing like pushing a new major update in order to find bugs > in the code when its exposed to a couple of hundred working > applications. Thankfully the fixes were almost as swift as the > reports. In any case, you''ll _definitely_ want to upgrade to 0.12.1 > right away. There''s a good handful of fixes for both Action Pack and > Active Record (mostly concerning the new eager loading). > > Here''s the dirt, so you don''t have to go look it up. First for Action > Pack: > > * Added xml_http_request/xhr method for simulating XMLHttpRequest in > functional tests #1151 [Sam Stephenson]. Example: xhr :post, :index > * Fixed that Ajax.Base.options.asynchronous wasn''t being respected in > Ajax.Request (thanks Jon Casey) > * Fixed that :get, :post, and the others should take a flash array as > the third argument just like process #1144 [rails-l0cZ0mwnNJulQ9BUahrlcQ@public.gmane.org] > * Fixed a problem with Flash.now > * Fixed stringification on all assigned hashes. The sacrifice is that > assigns[:person] won''t work in testing. Instead assigns["person"] or > assigns(:person) must be used. In other words, the keys of assigns > stay strings but we''ve added a method-based accessor to appease the > need for symbols. > * Fixed that rendering a template would require a connection to the > database #1146 > > Then for Active Record: > > * Fixed frivilous database queries being triggered with eager loading > on empty associations and other things > * Fixed order of loading in eager associations > * Fixed stray comma when using eager loading and ordering together > from has_many associations #1143 > > Updating, as always, couldn''t be easier than gem install rails > --include-dependencies > -- > David Heinemeier Hansson, > http://www.basecamphq.com/ -- Web-based Project Management > http://www.rubyonrails.org/ -- Web-application framework for Ruby > http://www.loudthinking.com/ -- Broadcasting Brain > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >
Andreas Schwarz
2005-Apr-20 08:56 UTC
Re: [ANN] Rails 0.12.1: No major update without a bit of pain
download.rubyonrails.com and Trac still have 0.11 as latest version number. Andreas
Florian Groß
2005-Apr-20 17:17 UTC
Re: [ANN] Rails 0.12.1: No major update without a bit of pain
Jeremy Huffman wrote:> Is there any way to eager load an acts_as_tree structure?I''ve been using this snippet for that:> def self.all_by_parent() > result = Hash.new { |hash, key| hash[key] = [] } > find_all.each do |category| > result[category.parent_id] << category > end > return result > endIt returns an parent_id => children hash and only needs to do one query at the cost of doing slightly more work in your application.