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.

Szymon Nowak's latest activity

Sunday, November 21 2010
5983 find_or_create_by doesn't work with protected attributes was updated in Ruby on Rails
Saturday, November 20 2010
5983 find_or_create_by doesn't work with protected attributes was updated in Ruby on Rails
  • Szymon Nowak
    Szymon Nowak commented at 3:58 PM

    @2kan: thanks for the link! It turns out that the bug is actually that find_or_initialize_by works with protected attributes in 2.3.10, although it shouldn't :)

  • Szymon Nowak
    Szymon Nowak commented at 3:15 PM

    First of all it's not a change in behavior from 2.2.x, but from 2.3.5 - I migrated my app from 2.3.5 directly to 2.3.10 and it stopped working.

    Second thing is ...

Tuesday, November 16 2010
5983 find_or_create_by doesn't work with protected attributes was updated in Ruby on Rails
  • Szymon Nowak
    Szymon Nowak commented at 8:10 PM

    I'll take a look at it over the weekend, but the workaround that I'm using for now is find_or_initialize_by + save.

  • Szymon Nowak
    Szymon Nowak commented at 1:19 PM
  • Szymon Nowak
    Szymon Nowak created the ticket at 1:16 PM

    There's some strange problem with find_or_create_by on has_many associations and protected attributes:
    user.posts.find_or_create_by_some_protected_attribute doe...

Monday, October 18 2010
5794 using include? on a time range yields unhappy results was updated in Ruby on Rails
  • Szymon Nowak
    Szymon Nowak commented at 7:44 PM

    I don't really think it's Rails issue. Just use Range#cover? instead:

    (1.day.ago..Time.now).cover? 3.hours.ago
    => true
    

    However, it's Ruby 1.9 only. If you're ...

Monday, October 11 2010
4991 Column definitions not cached for calculations on has_many association with :... was updated in Ruby on Rails
  • Szymon Nowak
    Szymon Nowak commented at 10:34 PM

    I'm not sure if it hasn't been already fixed in #5392

5199 respond_with returns " " on PUT and DELETE verb was updated in Ruby on Rails
  • Szymon Nowak
    Szymon Nowak commented at 6:46 PM

    Here's a patch that changes the behavior to return "{}" instead of " " for JSON requests with PUT and DELETE.

    It also allows to add new methods to return a vali...

Sunday, October 03 2010
5199 respond_with returns " " on PUT and DELETE verb was updated in Ruby on Rails
  • Szymon Nowak
    Szymon Nowak commented at 7:12 PM

    I'm not sure if this will actually solve this problem for JSON format, because empty string is still considered as invalid JSON - that's why most people use wha...