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.

Lawrence Pit's latest activity

Monday, July 21 2008
633 FormTagHelper#submit_tag with :disable_with option doesn't submit the button'... was updated in Ruby on Rails
  • Lawrence Pit
    Lawrence Pit commented at 2:51 AM

    I think you need to test whether the hidden field already exists or not. This is because the form can have a custom onsubmit handler (doing some ajax stuff for...

660 submit_tag :confirm bug was updated in Ruby on Rails
  • Lawrence Pit
    • Title changed from submit_tag :confirmation bug to submit_tag :confirm bug
    by Lawrence Pit at 2:43 AM
Saturday, July 19 2008
660 submit_tag :confirmation bug was updated in Ruby on Rails
  • Lawrence Pit
    Lawrence Pit commented at 11:42 AM

    Ah yeah, sorry, the example in this ticket should indeed use :confirm. The patch is correct though. I like the return true to be explicit.

  • Lawrence Pit
    Lawrence Pit created the ticket at 6:54 AM

    When doing any of the following:

      submit_tag "Save", :onclick => "alert('x');", :confirmation => "Sure?"
    
      submit_tag "Save", :disable_with => "Saving..."...
Tuesday, July 15 2008
621 find_last_by_* dynamic finder was updated in Ruby on Rails
  • Lawrence Pit
    Lawrence Pit commented at 5:00 AM

    Thanks for the comment. Attached new patch.

  • Lawrence Pit
    Lawrence Pit created the ticket at 2:51 AM

    This patch allows the following:

      Account.find_last_by_limit(50)
      Account.find_first_by_limit(50)
    
Monday, July 14 2008
490 Nested with_options merge hash values was updated in Ruby on Rails
  • Lawrence Pit
    Lawrence Pit commented at 3:17 AM

    just thinking, maybe we should add this method to OrderedHash? :

       def is_a?(o)
         o == Hash
       end
    

    Last patch implements this. Simplifies deep_merge.

  • Lawrence Pit
    Lawrence Pit commented at 3:01 AM

    Attached version with deep_merge.

    The code of deep_merge is a bit ugly though... You need to test for :to_hash for it to work with with_options, because Order...

Thursday, July 03 2008
542 Calculation queries do not take eager loading into account was created in Ruby on Rails
  • Lawrence Pit
    Lawrence Pit created the ticket at 7:20 AM

    When :include is used with a find (or defined within a scope), like for example:

      Project.scoped({:include => categories}).find(:limit => 15)
    

    then executio...

Sunday, June 29 2008
467 Hash Conditions belongs_to sugar was updated in Ruby on Rails
  • Lawrence Pit
    Lawrence Pit commented at 12:40 AM

    Now that Pratik mentions it, I agree with what he's saying. The things within a condition hash should always refer to actual table and column names.