Skip to content
This repository was archived by the owner on Aug 17, 2017. It is now read-only.
This repository was archived by the owner on Aug 17, 2017. It is now read-only.

Rails 4 migration clarification #226

Open
@scottjacobsen

Description

@scottjacobsen

The Rails 4 migration section of the documentation says to remove attr_accessible and attr_protected from the models being migrated. This will only work if you disable default whitelisting by setting:

config.active_record.whitelist_attributes = false

If default whitelisting is enable I found I need to disable the whitelist on a per model basis like this:

class Post < ActiveRecord::Base
   attr_protected # disable whitelist for this model
   include ActiveModel::ForbiddenAttributesProtection
end

Isn't it safer to keep default whitelisting enabled and disable only after the full migration is finished?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions