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
Conteúdo para você se capacitar em programação