hide index fields from api; closes #1739
This commit is contained in:
@@ -306,6 +306,24 @@ class Artist < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
module ApiMethods
|
||||
def hidden_attributes
|
||||
super + [:other_names_index]
|
||||
end
|
||||
|
||||
def legacy_api_hash
|
||||
return {
|
||||
:id => id,
|
||||
:name => name,
|
||||
:other_names => other_names,
|
||||
:group_name => group_name,
|
||||
:urls => artist_urls.map {|x| x.url},
|
||||
:is_active => is_active?,
|
||||
:updater_id => 0
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
include UrlMethods
|
||||
include NameMethods
|
||||
include GroupMethods
|
||||
@@ -315,6 +333,7 @@ class Artist < ActiveRecord::Base
|
||||
include TagMethods
|
||||
include BanMethods
|
||||
extend SearchMethods
|
||||
include ApiMethods
|
||||
|
||||
def status
|
||||
if is_banned? && is_active?
|
||||
@@ -328,18 +347,6 @@ class Artist < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def legacy_api_hash
|
||||
return {
|
||||
:id => id,
|
||||
:name => name,
|
||||
:other_names => other_names,
|
||||
:group_name => group_name,
|
||||
:urls => artist_urls.map {|x| x.url},
|
||||
:is_active => is_active?,
|
||||
:updater_id => 0
|
||||
}
|
||||
end
|
||||
|
||||
def initialize_creator
|
||||
self.creator_id = CurrentUser.user.id
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user