Skip to content

Commit

Permalink
Add syncable flag to boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
luciajanikova committed Sep 7, 2023
1 parent 2f235c2 commit b414f72
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/jobs/govbox/sync_all_boxes_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class SyncAllBoxesJob < ApplicationJob

def perform
Box.find_each do |box|
SyncBoxJob.perform_later(box)
SyncBoxJob.perform_later(box) if box.syncable?
end
end
end
Expand Down
1 change: 1 addition & 0 deletions app/models/box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# tenant_id :integer not null
# name :string not null
# uri :string
# syncable :boolean not null, default: true
# created_at :datetime not null
# updated_at :datetime not null

Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20230907123137_add_syncable_flag_to_boxes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddSyncableFlagToBoxes < ActiveRecord::Migration[7.0]
def change
add_column :boxes, :syncable, :boolean, null: false, default: true
end
end
3 changes: 2 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b414f72

Please sign in to comment.