-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Not send notifications when it should never notify assignment (#620
) * FIX: Not send notifications when it should never notify assignment - Added silenced_assignments table and migration to store silenced assignments - Added tests for silenced assignments * DEV: Add annotation to model * DEV: add empty line after early return * DEV: lint file
- Loading branch information
Showing
7 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
class SilencedAssignment < ActiveRecord::Base | ||
belongs_to :assignment | ||
end | ||
|
||
# == Schema Information | ||
# | ||
# Table name: silenced_assignments | ||
# | ||
# id :bigint not null, primary key | ||
# assignment_id :bigint not null | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# | ||
# Indexes | ||
# | ||
# index_silenced_assignments_on_assignment_id (assignment_id) UNIQUE | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
class CreateSilencedAssignments < ActiveRecord::Migration[7.2] | ||
def up | ||
create_table :silenced_assignments do |t| | ||
t.bigint :assignment_id, null: false | ||
t.timestamps | ||
end | ||
add_index :silenced_assignments, :assignment_id, unique: true | ||
end | ||
|
||
def down | ||
drop_table :silenced_assignments | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters