mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
parent
b0e3062fdf
commit
754e1238b0
@ -147,14 +147,12 @@ class Notification < ActiveRecord::Base
|
|||||||
|
|
||||||
# Be wary of calling this frequently. O(n) JSON parsing can suck.
|
# Be wary of calling this frequently. O(n) JSON parsing can suck.
|
||||||
def data_hash
|
def data_hash
|
||||||
@data_hash ||= begin
|
return {} if data.blank?
|
||||||
return {} if data.blank?
|
|
||||||
|
|
||||||
parsed = JSON.parse(data)
|
parsed = JSON.parse(data)
|
||||||
return {} if parsed.blank?
|
return {} if parsed.blank?
|
||||||
|
|
||||||
parsed.with_indifferent_access
|
parsed.with_indifferent_access
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def url
|
def url
|
||||||
@ -232,11 +230,6 @@ class Notification < ActiveRecord::Base
|
|||||||
Post.where(topic: topic_id, post_number: post_number).pluck_first(:id)
|
Post.where(topic: topic_id, post_number: post_number).pluck_first(:id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def reload(options = nil)
|
|
||||||
super
|
|
||||||
@data_hash = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def refresh_notification_count
|
def refresh_notification_count
|
||||||
|
Loading…
Reference in New Issue
Block a user