The code powering m.abunchtell.com https://m.abunchtell.com
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

27 Zeilen
658 B

  1. # frozen_string_literal: true
  2. # == Schema Information
  3. #
  4. # Table name: bookmarks
  5. #
  6. # id :integer not null, primary key
  7. # created_at :datetime not null
  8. # updated_at :datetime not null
  9. # account_id :integer not null
  10. # status_id :integer not null
  11. #
  12. class Bookmark < ApplicationRecord
  13. include Paginable
  14. update_index('statuses#status', :status) if Chewy.enabled?
  15. belongs_to :account, inverse_of: :bookmarks
  16. belongs_to :status, inverse_of: :bookmarks
  17. validates :status_id, uniqueness: { scope: :account_id }
  18. before_validation do
  19. self.status = status.reblog if status&.reblog?
  20. end
  21. end