search for: has_backup_table

Displaying 1 result from an estimated 1 matches for "has_backup_table".

2006 Jan 13
1
association callbacks
...ing a plugin that will log all model changes. I do not want to have to add a line a code for this functionality every time I create a model. Instead I create a table with the name <model>_changes. The basic stuff was easy: base.after_create {|model| model.log_create if model.has_backup_table? } **also log on before_update and before_destroy What I''m curious about is the habtm relationships. I wanted to keep track of when this changes as well. An example would be changing a user''s role. So I did this: def self.included(base) ... base.before_validat...