Remove all memberships where belonging group was deleted.

This commit is contained in:
Benjamin Meichsner 2014-09-21 12:54:01 +02:00
parent 0231df9d5b
commit c750416b9e
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class RemoveStaleMemberships < ActiveRecord::Migration
def up
Membership.where("group_id NOT IN (?)", Group.ids).delete_all
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140521142651) do ActiveRecord::Schema.define(version: 20140921104907) do
create_table "article_categories", force: true do |t| create_table "article_categories", force: true do |t|
t.string "name", default: "", null: false t.string "name", default: "", null: false