Skip to content

Commit

Permalink
fix boolean checks in postarchive
Browse files Browse the repository at this point in the history
  • Loading branch information
r888888888 committed Feb 27, 2017
1 parent 16cd879 commit a90a1bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/post_archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,23 +192,23 @@ def changes
latest_tags << "parent:#{post.parent_id}" if post.parent_id.present?
latest_tags << "source:#{post.source}" if post.source.present?

if parent_changed?
if parent_changed
delta[:added_tags] << "parent:#{parent_id}"

if previous
delta[:removed_tags] << "parent:#{previous.parent_id}"
end
end

if rating_changed?
if rating_changed
delta[:added_tags] << "rating:#{rating}"

if previous
delta[:removed_tags] << "rating:#{previous.rating}"
end
end

if source_changed?
if source_changed
delta[:added_tags] << "source:#{source}"

if previous
Expand Down Expand Up @@ -285,7 +285,7 @@ def updater
end

def method_attributes
super + [:added_tags, :removed_tags, :obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags, :updater_name]
super + [:obsolete_added_tags, :obsolete_removed_tags, :unchanged_tags, :updater_name]
end

memoize :previous, :post, :tag_array, :changes, :added_tags_with_fields, :removed_tags_with_fields, :obsolete_removed_tags, :obsolete_added_tags, :unchanged_tags
Expand Down

0 comments on commit a90a1bd

Please sign in to comment.