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.

Paweł Kondzior's latest activity

Saturday, February 14 2009
692 Defining routes with symbols failes was updated in Ruby on Rails
1960 Make named_scopes remember the current scope when defined was updated in Ruby on Rails
Wednesday, December 17 2008
1202 Add attributes writer method for an association. was updated in Ruby on Rails
Sunday, December 14 2008
1570 named_scope not preserving proper model in STI was updated in Ruby on Rails
  • Paweł Kondzior
    Paweł Kondzior commented at 5:33 PM

    Same stuff but here i'm using instance_exec functionality.

  • Paweł Kondzior
    Paweł Kondzior commented at 3:49 PM

    And here it is.

  • Paweł Kondzior
    Paweł Kondzior commented at 3:16 PM

    I hoped that solution will be easy, and i was right :) Active Support gives us Proc#bind that emulates 1.9 instance_exec (instance_eval with arguments)

    It was a...

  • Paweł Kondzior
    Paweł Kondzior commented at 11:29 AM

    Yup, i figured out that. But still, problem exists. Workaround could be redefine simple_test from Employee method, but we do STI to be DRY, this is not DRY. The...

  • Paweł Kondzior
    Paweł Kondzior commented at 3:33 AM
    
    class Employee < User
    end
    

    And because it's bit late, i did typo in example code :(

1 earlier change…
  • Paweł Kondzior
    Paweł Kondzior commented at 3:27 AM
    
    Loading development environment (Rails 2.3.0)
    >> Employee.simple_test(123)
    User(id: integer, created_at: datetime, updated_at: datetime, active: boolean, typ...