We have some code that needs to run on our ActiveRecord 'Town' whenever it is loaded.
If we load it like this, we can use afterFind to do this:
However, if we load it through a relation in the User active record, afterFind doesn't get called.
Are we doing something wrong? What's the best solution?
If we load it like this, we can use afterFind to do this:
Town::model()->findByPk(1)
However, if we load it through a relation in the User active record, afterFind doesn't get called.
Are we doing something wrong? What's the best solution?