Class: TrackSetOrigin

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
TrackSetExtender
Defined in:
lib/ting_model/track_set_origin.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TrackSetExtender

del_cache, fetch, mfetch

Class Method Details

.hashlize(obj) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/ting_model/track_set_origin.rb', line 80

def self.hashlize(obj)
  {
    id: obj.id,
    uid: obj.uid,
    nickname: obj.nickname,
    avatar_path: obj.avatar_path,
    is_v: obj.is_v,
    is_public: obj.is_public,
    is_publish: obj.is_publish,
    user_source: obj.user_source,
    category_id: obj.category_id,
    tags: obj.tags,
    title: obj.title,
    intro: obj.intro,
    cover_path: obj.cover_path,
    created_at: obj.created_at,
    updated_at: obj.updated_at,
    music_category: obj.music_category,
    tracks_order: obj.tracks_order,
    is_crawler: obj.is_crawler,
    rich_intro: obj.rich_intro,
    op_type: obj.op_type,
    short_intro: obj.short_intro,
    is_deleted: obj.is_deleted,
    source_url: obj.source_url,
    is_records_desc: obj.is_records_desc,
    last_uptrack_at: obj.last_uptrack_at,
    last_uptrack_id: obj.last_uptrack_id,
    last_uptrack_title: obj.last_uptrack_title,
    last_uptrack_cover_path: obj.last_uptrack_cover_path,
    status: obj.status,
    dig_status: obj.dig_status,
    human_category_id: obj.human_category_id
  }
end

Instance Method Details

#is_crawler_dispObject



138
139
140
141
142
143
144
145
# File 'lib/ting_model/track_set_origin.rb', line 138

def is_crawler_disp
  case self.is_crawler
    when true
      '爬虫'
    when false
      '用户'
  end
end

#is_publish_dispObject



116
117
118
119
120
121
122
123
124
125
# File 'lib/ting_model/track_set_origin.rb', line 116

def is_publish_disp
  case self.is_publish
    when true
      '审核通过'
    when false
      '审核不通过'
    else
      '审核通过'
  end
end

#to_topic_hashObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/ting_model/track_set_origin.rb', line 54

def to_topic_hash
  {
    created_at: self.created_at,
    updated_at: self.updated_at,
    id: self.id,
    uid: self.uid,
    nickname: self.nickname,
    avatar_path: self.avatar_path,
    is_v: self.is_v,
    human_category_id: self.human_category_id,
    is_public: self.is_public,
    is_publish: self.is_publish,
    user_source: self.user_source,
    category_id: self.category_id,
    tags: self.tags,
    title: self.title,
    intro: self.intro,
    cover_path: self.cover_path,
    music_category: self.music_category,
    is_deleted: self.is_deleted,
    status: self.status,
    dig_status: self.dig_status,
    extra_tags: self.extra_tags
  }
end

#user_source_dispObject



127
128
129
130
131
132
133
134
135
136
# File 'lib/ting_model/track_set_origin.rb', line 127

def user_source_disp
  case user_source
    when 1
      '原创'
    when 2
      '采集'
    else
      ''
  end
end