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
Post a Comment