This commit is contained in:
@@ -81,7 +81,7 @@ class Tag < ApplicationRecord
|
||||
|
||||
def material_id = materials.first&.id
|
||||
|
||||
def has_deerjikists = deerjikists.present?
|
||||
def has_deerjikists = deerjikists.exists?
|
||||
|
||||
def self.tagme = find_or_create_by_tag_name!('タグ希望', category: :meta)
|
||||
def self.bot = find_or_create_by_tag_name!('bot操作', category: :meta)
|
||||
|
||||
@@ -7,6 +7,8 @@ class Theatre < ApplicationRecord
|
||||
class_name: 'TheatreWatchingUser', inverse_of: :theatre
|
||||
has_many :watching_users, through: :active_theatre_watching_users, source: :user
|
||||
|
||||
has_many :programmes, class_name: 'TheatreProgramme'
|
||||
|
||||
belongs_to :host_user, class_name: 'User', optional: true
|
||||
belongs_to :current_post, class_name: 'Post', optional: true
|
||||
belongs_to :created_by_user, class_name: 'User'
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class TheatreProgramme < ApplicationRecord
|
||||
self.primary_key = :theatre_id, :position
|
||||
|
||||
belongs_to :theatre
|
||||
belongs_to :post
|
||||
end
|
||||
Reference in New Issue
Block a user