-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand Featureable to all Tools (#4094)
This adds `featured_status` and `featured_at` to tables for tools that didn't have it: - logos - podcasts - episodes - journals - videos
- Loading branch information
1 parent
7bac523
commit 71083fc
Showing
10 changed files
with
94 additions
and
48 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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class Episode < ApplicationRecord | ||
include Name | ||
include Featureable | ||
include Publishable | ||
|
||
belongs_to :podcast | ||
|
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
class Issue < ApplicationRecord | ||
include MultiPageTool | ||
include Featureable | ||
|
||
belongs_to :journal | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class Podcast < ApplicationRecord | ||
include Name | ||
include Featureable | ||
|
||
has_many :episodes, dependent: :destroy | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
class Video < ApplicationRecord | ||
include Tool | ||
include Featureable | ||
|
||
has_one_attached :image_poster_frame | ||
|
||
|
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,33 @@ | ||
class AddFeaturedToAllTools < ActiveRecord::Migration[7.2] | ||
def change | ||
# logos | ||
change_table :logos, bulk: true do |t| | ||
t.boolean :featured_status, default: false, null: false | ||
t.datetime :featured_at, precision: nil | ||
end | ||
|
||
# podcasts | ||
change_table :podcasts, bulk: true do |t| | ||
t.boolean :featured_status, default: false, null: false | ||
t.datetime :featured_at, precision: nil | ||
end | ||
|
||
# episodes | ||
change_table :episodes, bulk: true do |t| | ||
t.boolean :featured_status, default: false, null: false | ||
t.datetime :featured_at, precision: nil | ||
end | ||
|
||
# journals | ||
change_table :journals, bulk: true do |t| | ||
t.boolean :featured_status, default: false, null: false | ||
t.datetime :featured_at, precision: nil | ||
end | ||
|
||
# videos | ||
change_table :videos, bulk: true do |t| | ||
t.boolean :featured_status, default: false, null: false | ||
t.datetime :featured_at, precision: nil | ||
end | ||
end | ||
end |
Oops, something went wrong.