Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign attributes #357

Merged
merged 2 commits into from May 1, 2011
Merged

Assign attributes #357

merged 2 commits into from May 1, 2011

Conversation

joshk
Copy link
Contributor

@joshk joshk commented May 1, 2011

Hey Guys,

This adds :as and :without_protection support to AR.new and create, as well as associations, eg.

u = User.create({ :name => 'Josh', :is_admin => true }, :as => :admin)
u.applications.create({ :name => 'travis', :rating => 5 }, :as => :admin)

Let me know if you see any issues.

Thanks,

Josh

joshk added 2 commits May 1, 2011 23:08
…nt security options (:as and :without_protection) in build, create and create! methods.
dhh added a commit that referenced this pull request May 1, 2011
Assign protected attributes with create/new and control the role.
@dhh dhh merged commit a8861c8 into rails:master May 1, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants