github
0 of 18 new or added lines in 4 files covered. (0.0%)
3922 existing lines in 105 files now uncovered.0 of 4086 relevant lines covered (0.0%)
0.0 hits per line
1 |
# frozen_string_literal: true
|
|
2 |
|
|
3 |
# == Schema Information
|
|
4 |
#
|
|
5 |
# Table name: shows
|
|
6 |
#
|
|
7 |
# id :integer not null, primary key
|
|
8 |
# name :string not null
|
|
9 |
# details :text
|
|
10 |
# profile_id :integer not null
|
|
11 |
# created_at :datetime
|
|
12 |
# updated_at :datetime
|
|
13 |
# creator_id :integer
|
|
14 |
# updater_id :integer
|
|
15 |
#
|
|
16 |
|
|
UNCOV
17
|
class Show < ApplicationRecord |
× |
18 |
|
|
UNCOV
19
|
include UserStampable
|
× |
20 |
|
|
UNCOV
21
|
belongs_to :profile
|
× |
22 |
|
|
UNCOV
23
|
has_many :broadcasts, dependent: :restrict_with_error |
× |
24 |
|
|
UNCOV
25
|
validates :name, presence: true, uniqueness: { case_sensitive: false } |
× |
26 |
|
|
UNCOV
27
|
before_validation :set_default_profile_id
|
× |
28 |
|
|
UNCOV
29
|
scope :list, -> { order(Arel.sql('LOWER(shows.name)')) } |
× |
30 |
|
|
UNCOV
31
|
def to_s |
× |
UNCOV
32
|
name |
× |
UNCOV
33
|
end
|
× |
34 |
|
|
UNCOV
35
|
def profile |
× |
UNCOV
36
|
super || Profile.default |
× |
UNCOV
37
|
end
|
× |
38 |
|
|
UNCOV
39
|
private |
× |
40 |
|
|
UNCOV
41
|
def set_default_profile_id |
× |
UNCOV
42
|
self.profile_id ||= Profile.default.id |
× |
UNCOV
43
|
end
|
× |
44 |
|
|
UNCOV
45
|
end
|
× |