dirty Blogs
Written by Kiprosh, team of passionate and disciplined craftsmen turning your ideas into reality.
Kiprosh is now part of LawLytics
Written by Kiprosh, team of passionate and disciplined craftsmen turning your ideas into reality.
Performing an action via a callback is fairly easy and doable. Sometimes requirement may be a bit enhance that we need to track every change now and then. On the same note, if we have associations and we wanted to make some changes that needs to be reflected on previous and new values, this dirty concepts can save our time. This module gives a way to track changes done in an active-record object. By default, rails include ActiveRecord::Dirty this module. This gives many powerful methods that helps us to track attribute changes. This methods are based on the attribute