ruby - Rails 4: ActiveRecord method '_was' for tagging attibutes -


i'm new rails , found attribute'_was' method convenient track model's attribute before changed.

but when want find before value of tagging attribute, '_was' method not work.

for exemple :

i got 3 models article, articletag, articletagging.

an article has_many article_tags through article_tagging.

i can't use article.article_tags_was article.name_was.

dose rails has method before value of tagging attribute?

article_tags association. _was works on model attributes. may check whether 1 of associated articletag objects changed with

article.article_tags.any? { |tag| tag.changed? } 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -