#
class DiaryComment < ApplicationRecord
- belongs_to :user
+ belongs_to :user, :counter_cache => true
belongs_to :diary_entry
scope :visible, -> { where(:visible => true) }
sha256 << Rails.application.key_generator.generate_key("openstreetmap/diary_comment")
sha256 << id.to_s
sha256 << subscriber.to_s
- sha256.base64digest[0, 8]
+ Base64.urlsafe_encode64(sha256.digest)[0, 8]
end
private