Remove all memberships where belonging group was deleted.
This commit is contained in:
parent
0231df9d5b
commit
c750416b9e
2 changed files with 6 additions and 1 deletions
5
db/migrate/20140921104907_remove_stale_memberships.rb
Normal file
5
db/migrate/20140921104907_remove_stale_memberships.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class RemoveStaleMemberships < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
Membership.where("group_id NOT IN (?)", Group.ids).delete_all
|
||||||
|
end
|
||||||
|
end
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue