Adding compatibility with Rails 4

requires ActiveModel only if not defined