Merge Request #9
← To merge requests
From
export-comment-paragraph-rails3
into
production
Export comment paragraph rails3
Added paragraph id and comment_reply_to. Moved changes from Rails 4 to 3
Commits (49)
-
You should use
self.parent_id_changed?
to verify if the parent_id was changed. -
This Rails feature
attribute_changed?
is pretty awesome @vfcosta !! Many thanks to share this with me :) I had no idea about this behavior. After your response, I made a research about this and I found it likeActiveModel::Dirty
, where you can usechanged_attributes
to check more than one model attribute!I made this changes in the same last commit and forced update. Please, verify now if everything it's ok!!
-
mentioned in commit a86306b1acc9b945fb1c5c33015724a1487b9fac
-
this line may be removed.
started a discussion on commit
a86306b1
app/models/article.rb
842 | 850 | sanitizer.sanitize(text) |
843 | 851 | end |
844 | 852 | |
853 | + def parent_archived? | |
854 | + if (self.old_parent_id != self.parent_id) && self.parent && self.parent.archived? | |
2 |
|
started a discussion on commit
a86306b1
app/controllers/my_profile/cms_controller.rb
99 | 99 | @article.image.save! |
100 | 100 | end |
101 | 101 | @article.last_changed_by = user |
102 | + @article.old_parent_id = @article.parent_id | |
1 |
|
started a discussion on commit
a86306b1
started a discussion on commit
a86306b1
app/models/article.rb
9 | 9 | :highlighted, :notify_comments, :display_hits, :slug, |
10 | 10 | :external_feed_builder, :display_versions, :external_link, |
11 | 11 | :image_builder, :show_to_followers, |
12 | - :author, :display_preview | |
12 | + :author, :display_preview, :archived | |
13 | + | |
14 | + attr_accessor :old_parent_id | |
1 |
|