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::ReadOnlyRecordIf you wanted to do write on object then you need to pass following option to find query.:readonly … Continue reading ActiveRecord::ReadOnlyRecord while updating object fetched by joins