favorites: remove is_favorited attribute from post API.
* Remove the data-is-favorited attribute from post thumbnails. * Remove the is_favorited attribute from the /posts.json API. * Remove the fav_string attribute from the /posts.json API (only visible to moderators). * Change `Post#favorited_by?` to not use the fav_string. Further addresses #4652 by eliminating the last places where fav_string was used.
This commit is contained in:
@@ -88,11 +88,11 @@ class PostPolicy < ApplicationPolicy
|
||||
|
||||
def api_attributes
|
||||
attributes = super
|
||||
attributes += [:has_large, :has_visible_children, :is_favorited?]
|
||||
attributes += [:has_large, :has_visible_children]
|
||||
attributes += TagCategory.categories.map {|x| "tag_string_#{x}".to_sym}
|
||||
attributes += [:file_url, :large_file_url, :preview_file_url] if visible?
|
||||
attributes -= [:id, :md5, :file_ext] if !visible?
|
||||
attributes -= [:fav_string] if !user.is_moderator?
|
||||
attributes -= [:fav_string]
|
||||
attributes
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user