foodsoft/db/migrate/20140921104907_remove_stale_memberships.rb

6 lines
145 B
Ruby
Raw Permalink Normal View History

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