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.

Ivan Ukhov's latest activity

Sunday, January 30 2011
1812 default_scope can't take procs was updated in Ruby on Rails
Saturday, January 29 2011
1812 default_scope can't take procs was updated in Ruby on Rails
  • Ivan Ukhov
    Ivan Ukhov commented at 2:21 PM

    Please also try with regular scopes + where, order, etc. Again they will just overwrite default scopes. My workaround is a module called DynamicDefaultScoping, ...

Friday, January 28 2011
1812 default_scope can't take procs was updated in Ruby on Rails
  • Ivan Ukhov
    Ivan Ukhov commented at 7:31 PM

    Actually, this is a problem with all defined scopes in the model using scope and new arel syntax. All regular scopes will overwrite default ones.

  • Ivan Ukhov
    Ivan Ukhov commented at 6:58 PM

    Adam Wróbel,

    about your patch, try to change the order of the default_scope calls in the model like:

    class Widget < ActiveRecord::Base
      default_scope lambda {...
Saturday, November 20 2010
2824 [Patch] has_many :through doesn't update counter_cache on join model correctly. was updated in Ruby on Rails
Friday, November 12 2010
5958 Collection rendering with superfluous database queries was updated in Ruby on Rails
  • Ivan Ukhov
    Ivan Ukhov commented at 11:16 PM

    Neeraj Singh, not a problem at all, it's a pleasure for me to contribute a bit to this great framework) Thank you for your consideration and quick responce.

  • Ivan Ukhov
    Ivan Ukhov commented at 5:48 PM

    You say:
    Other thing is that if the collection is not already loaded then .size internally calls .length .

    Josh says:
    If the collection has already been loaded,...

  • Ivan Ukhov
    Ivan Ukhov commented at 5:05 PM
  • Ivan Ukhov
    Ivan Ukhov commented at 4:41 PM

    [PATCH] Do not execute query to get count of records twice.

    The problem is not in how many times it counts, but in the fact that it produces two different queri...

  • Ivan Ukhov
    Ivan Ukhov commented at 4:33 PM

    The patch is not correct, because it still calls size, but should call length. size in case of not loaded collection fires a counting query.

    So, in the patch in...