rubysherpas / r4ia

A place to file issues for Rails 4 in Action
2 stars 0 forks source link

Chapter 10.8.3 V17 #5

Closed axelkanakan closed 9 years ago

axelkanakan commented 9 years ago

Went into the rails console and did

user = User.create!(email: "test@example.com", password: "password") user.save #because confirm! and confirm were not defined and finally when i did

user.permissions.create({thing: Project.first, action: "view"}, without_protection: true)

i got the error ArgumentError: wrong number of arguments (2 for 0..1) so not sure what wrong...

here's my github: https://github.com/krillencoder/ticketee

radar commented 9 years ago

Hi @krillencoder, :without_protection has been removed in Rails 4. What I suspect has happened is that this section in Chapter 10 hasn't been updated to remove that option.

We'll fix it up once we get to the review for that chapter. Thanks for letting us know about it.

radar commented 9 years ago

Actually this was easy enough to fix without waiting for the review. I've done that just now.

axelkanakan commented 9 years ago

Okay I omitted the without_protection part, and the reason it wasn't saving the user was because i didn't add the password_confirmation. Thank you