-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
class TermResource < Madmin::Resource | ||
# Attributes | ||
attribute :id, form: false | ||
attribute :id, form: false, index: false | ||
attribute :name | ||
attribute :title | ||
attribute :content | ||
attribute :slug | ||
attribute :created_at, form: false | ||
attribute :updated_at, form: false | ||
attribute :created_at, form: false, index: false | ||
attribute :updated_at, form: false, index: false | ||
attribute :video_id | ||
attribute :video_title | ||
attribute :video_description | ||
attribute :video_thumbnail_url | ||
attribute :video_upload_date | ||
attribute :video_duration | ||
|
||
def self.model_find(id) | ||
model.find_by!(slug: id) | ||
end | ||
|
||
# Associations | ||
|
||
# Uncomment this to customize the display name of records in the admin area. | ||
# def self.display_name(record) | ||
# record.name | ||
# end | ||
def self.display_name(record) | ||
record.name | ||
end | ||
|
||
# Uncomment this to customize the default sort column and direction. | ||
# def self.default_sort_column | ||
# "created_at" | ||
# end | ||
def self.default_sort_column | ||
"name" | ||
end | ||
# | ||
# def self.default_sort_direction | ||
# "desc" | ||
# end | ||
def self.default_sort_direction | ||
"asc" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class AddVideoToTerms < ActiveRecord::Migration[7.2] | ||
def change | ||
add_column :terms, :video_id, :string | ||
add_column :terms, :video_title, :string | ||
add_column :terms, :video_description, :text | ||
add_column :terms, :video_thumbnail_url, :string | ||
add_column :terms, :video_upload_date, :date | ||
add_column :terms, :video_duration, :string | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.