acts_as_archive icon indicating copy to clipboard operation
acts_as_archive copied to clipboard

Possible issue with loading from yaml file

Open foresth opened this issue 13 years ago • 0 comments

Hello, I was trying to find out why rake db:migrate wouldn't create any new tables even though I had the yaml config file specified correctly.

I found out you are trying to evaluate the model name (e.g. Article) in the load_from_yaml method during rails initialization and if something fails you rescue it with nil. The problem is you might have e.g. some acts_as_* statements in the affected model that hasn't been met yet. E.g. you utilize an acts_as_train plugin in the model but the plugin hasn't been loaded so in the "klass = eval(klass) rescue nil" statement you get an undefined method 'acts_as_train' error which results in nil.

If I install acts_as_archived as plugin and set the plugin load order to [:all, :acts_as_archived], it starts working.

foresth avatar Apr 05 '11 10:04 foresth