Skip to content

Commit

Permalink
Fixed issue with migration running on empty db (bigbluebutton#812)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad authored and jfederico committed Oct 10, 2019
1 parent 4a791ae commit c14f4dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/concerns/deleteable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module Deleteable
extend ActiveSupport::Concern

included do
# By default don't include deleted
default_scope { where(deleted: false) }
# By default don't include deleted if the column has been created
default_scope { where(deleted: false) } if column_names.include? 'deleted'
scope :include_deleted, -> { unscope(where: :deleted) }
scope :deleted, -> { include_deleted.where(deleted: true) }
end
Expand Down

0 comments on commit c14f4dc

Please sign in to comment.