Tag Archives: joins

ActiveRecord::ReadOnlyRecord while updating object fetched by joins

ActiveRecord find with join options retrieves object as readonly. station = Station.find( :first, :joins => :call, :conditions => [“customer_id = ? and date(insurance_expiry_date) = ?”, customer.id, insurance_expiry_date ] ) Readonly object cannot modified.  station.update_attributes({ :customer_id => 12 }) should raise … Continue reading

Posted in Ruby on Rails | Tagged , | Leave a comment