Added bookmarks
• Added:
- bookmarks for GabPRO members only
- migration for creation of StatusBookmarks
- all necessary routes, controllers
- redux for adding, removing, fetching and displaying bookmarks
- bookmark icon
- doorkeeper scopes
- backend and frontend support
Bookmarks behave like likes/favorites, except they aren't shared with other users and do not have an associated counter.
dfea7368c9
This commit is contained in:
@@ -19,6 +19,10 @@ module AccountAssociations
|
||||
has_many :conversations, class_name: 'AccountConversation', dependent: :destroy, inverse_of: :account
|
||||
has_many :scheduled_statuses, inverse_of: :account, dependent: :destroy
|
||||
|
||||
# Pinned statuses
|
||||
has_many :status_bookmarks, inverse_of: :account, dependent: :destroy
|
||||
has_many :bookmarked_statuses, -> { reorder('status_bookmarks.created_at DESC') }, through: :status_bookmarks, class_name: 'Status', source: :status
|
||||
|
||||
# Pinned statuses
|
||||
has_many :status_pins, inverse_of: :account, dependent: :destroy
|
||||
has_many :pinned_statuses, -> { reorder('status_pins.created_at DESC') }, through: :status_pins, class_name: 'Status', source: :status
|
||||
|
||||
@@ -189,6 +189,10 @@ module AccountInteractions
|
||||
status.proper.favourites.where(account: self).exists?
|
||||
end
|
||||
|
||||
def bookmarked?(status)
|
||||
status_bookmarks.where(account: self).exists?
|
||||
end
|
||||
|
||||
def reblogged?(status)
|
||||
status.proper.reblogs.where(account: self).exists?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user