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 following error. ActiveRecord::ReadOnlyRecord If you wanted to do write on object then you need toContinue reading “ActiveRecord::ReadOnlyRecord while updating object fetched by joins”