Rails verifica se has_many mudou

class Company < ActiveRecord::Base
has_many
:employees
accepts_nested_attributes_for
:employees

def employees_changed?
employees
.select { |e| e.new_record? || e.marked_for_destruction? }.any?
end
end