made a further step in adapting code for Rails 3.2.12, still broken though