models: move html_data_attributes to policies.
Move html_data_attributes definitions from models to policies. Which attributes are permitted as data-* attributes is a view level concern and should be defined on the policy level, not the model level. Models should be agnostic about how they're used in views.
This commit is contained in:
@@ -190,10 +190,6 @@ class ForumTopic < ApplicationRecord
|
||||
title.gsub(/\A\[APPROVED\]|\[REJECTED\]/, "")
|
||||
end
|
||||
|
||||
def html_data_attributes
|
||||
super + [:is_read?]
|
||||
end
|
||||
|
||||
def self.searchable_includes
|
||||
[:creator, :updater, :forum_posts, :bulk_update_requests, :tag_aliases, :tag_implications]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user