Class: AlbumOrigin

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

Instance Method Summary collapse

Methods included from AlbumExtender

decr_user_albums_count, next_id

Instance Method Details

#is_crawler_dispObject



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

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

#is_publish_dispObject



106
107
108
109
110
111
112
113
114
115
# File 'lib/ting_model/album_origin.rb', line 106

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

#to_topic_hashObject



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
# File 'lib/ting_model/album_origin.rb', line 80

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



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

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