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.

Robert Pankowecki's latest activity

Monday, July 19 2010
5125 collection_singular_ids= method raises an exception when primary_key is strin... was updated in Ruby on Rails
  • Robert Pankowecki
    Robert Pankowecki commented at 6:24 PM

    But I have one question before: How should the method behave when the given list of ids constains unexisting id? Raise an exception or just ignore it silently?

  • Robert Pankowecki
    Robert Pankowecki commented at 6:22 PM

    I just found that my patch brokes the method when primary_key is a number. I'm goinh to post soon a better version.

Friday, July 16 2010
5132 Merging two relations (ActiveRecord::Relation) created with joins() method do... was created in Ruby on Rails
  • Robert Pankowecki
    Robert Pankowecki created the ticket at 9:38 AM
    class Containment < ActiveRecord::Base
      belongs_to :child, :class_name => 'Unit'
    end
    
    Containment.joins(:child => :properties) works fine but
    
    Containment.joi...
5131 Preloading associations generates invalid sql for STI and has_many :through w... was created in Ruby on Rails
  • Robert Pankowecki
    Robert Pankowecki created the ticket at 7:14 AM
    class Role < ActiveRecord::Base
      has_many :user_roles
      has_many :users, :through => :user_roles
    end
    
    class User < BusinessObject # STI
      has_many :user_roles...
Thursday, July 15 2010
5125 collection_singular_ids= method raises an exception when primary_key is strin... was updated in Ruby on Rails
  • Robert Pankowecki
    Robert Pankowecki commented at 9:26 PM

    Could not reproduce your statement about Arel

    ruby-1.9.2-head > Role.primary_key
     => "name"
    
    ruby-1.9.2-head > role = Role.arel_table
    
    ruby-1.9.2-head > role.w...
  • Robert Pankowecki
    Robert Pankowecki commented at 9:21 PM

    Sending patch and tests for this case.

  • Robert Pankowecki
    Robert Pankowecki commented at 7:26 PM

    I will try :-)

  • Robert Pankowecki
    Robert Pankowecki created the ticket at 5:53 PM

    Using collection_singular_ids= (method generated by has_many) raises an exception when class primary_key is string.

    Example:

    class Role < ActiveRecord::Base
      ...
5117 validates_uniqueness_of fails when primary key value changed was created in Ruby on Rails
  • Robert Pankowecki
    Robert Pankowecki created the ticket at 10:27 AM
    class Role
      set_primary_key :short_name
      validates_uniqueness_of :name
    end
    
    test "validates_uniqueness_of" do
      r = Role.new(:name => "name" )
      r.short_name...