I don't know how robust this is, but the following predicate *does* appear to distinguish between the two cases correctly:

    if record.class.respond_to?(:protected_attributes) && record.class.respond_to?(:accessible_attributes)
      # Rails 3 and Rails 4 + rails/protected_attributes
    else
      # Rails 4 without rails/protected_attributes
    end