Skip to content

Instantly share code, notes, and snippets.

@KensoDev
Created August 30, 2013 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KensoDev/6387722 to your computer and use it in GitHub Desktop.
Save KensoDev/6387722 to your computer and use it in GitHub Desktop.
def remove_records(existing_records, records, method)
records.each { |record| callback(:before_remove, record) }
delete_records(existing_records, method) if existing_records.any?
records.each { |record| target.delete(record) }
records.each { |record| callback(:after_remove, record) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment