API: remove various associated fields included by default.
Remove various associated fields that were included by default on certain endpoints. API users can use the only param to include the full association if they need these fields. * /artists.json: urls. * /artist_urls.json: artist. * /comments.json: creator_name and updater_name. * /notes.json: creator_name. * /pools.json: creator_name. * /posts.json: uploader_name, children_ids, pixiv_ugoira_frame_data. * /post_appeals.json: is_resolved. * /post_versions.json: updater_name. * /uploads.json: uploader_name.
This commit is contained in:
@@ -11,8 +11,6 @@ class Note < ApplicationRecord
|
||||
after_save :create_version
|
||||
validate :post_must_not_be_note_locked
|
||||
|
||||
api_attributes including: [:creator_name]
|
||||
|
||||
module SearchMethods
|
||||
def active
|
||||
where("is_active = TRUE")
|
||||
@@ -28,10 +26,6 @@ class Note < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def creator_name
|
||||
creator.name
|
||||
end
|
||||
|
||||
extend SearchMethods
|
||||
|
||||
def post_must_not_be_note_locked
|
||||
|
||||
Reference in New Issue
Block a user