app/models/concerns/thredded/topic_common.rb in thredded-0.12.2 vs app/models/concerns/thredded/topic_common.rb in thredded-0.12.3
- old
+ new
@@ -6,10 +6,11 @@
included do
paginates_per 50 if respond_to?(:paginates_per)
belongs_to :last_user,
class_name: Thredded.user_class_name,
- foreign_key: 'last_user_id'
+ foreign_key: 'last_user_id',
+ **(Thredded.rails_gte_51? ? { optional: true } : {})
scope :order_recently_posted_first, -> { order(last_post_at: :desc, id: :desc) }
scope :on_page, ->(page_num) { page(page_num) }
validates :hash_id, presence: true, uniqueness: true