foodsoft/db/migrate/20140921104907_remove_stale...

6 lines
145 B
Ruby

class RemoveStaleMemberships < ActiveRecord::Migration[4.2]
def up
Membership.where("group_id NOT IN (?)", Group.ids).delete_all
end
end