fix ActiveRecord model for older ActiveRecord versions