paths_of_glory icon indicating copy to clipboard operation
paths_of_glory copied to clipboard

Can't mass-assign protected attributes (Achievable, level, ref)

Open francoisneron opened this issue 13 years ago • 9 comments

I wonder if it's a issue or if I should redo by myself the achivements model to add attr_accessible.

francoisneron avatar Apr 03 '12 18:04 francoisneron

This will be an issue with the newest version of rails since they patched it. You can change it in the config. See http://weblog.rubyonrails.org/2012/3/30/ann-rails-3-2-3-has-been-released/ for details.

I have made a pull request for this. If you could change:

gem 'paths_of_glory', :git => 'git://github.com/raid5/paths_of_glory.git', :branch => 'rails3'

to

gem 'paths_of_glory', :git => 'git://github.com/Gazler/paths_of_glory.git', :branch => 'rails3'

And let me know if you still get the issue?

Gazler avatar Apr 03 '12 19:04 Gazler

So basically, config.active_record.whitelist_attributes has to be set to true. To set all attributes has accessible.

francoisneron avatar Apr 03 '12 19:04 francoisneron

In *application.rb right.

francoisneron avatar Apr 03 '12 19:04 francoisneron

It is set to true by default. If you set it to false then you will no longer get the error, but that is not an optimal fix. Please try out my fork gem 'paths_of_glory', :git => 'git://github.com/Gazler/paths_of_glory.git', :branch => 'rails3' and let me know if you still get the issue.

Gazler avatar Apr 03 '12 19:04 Gazler

Can't mass-assign protected attributes: achievable, ref

I'm getting this.. Fixed only level I guess ;) ?

francoisneron avatar Apr 03 '12 20:04 francoisneron

I have push again and would appreciate it if you could check it again. Thanks for testing it btw.

Gazler avatar Apr 03 '12 20:04 Gazler

do I run bundle install to get your latest version if I have it in my gemfile?

francoisneron avatar Apr 03 '12 20:04 francoisneron

Running bundle update paths_of_glory should do the trick.

Gazler avatar Apr 03 '12 20:04 Gazler

It works! Thank you very much. I was thinking about starting from scratch ;)

francoisneron avatar Apr 03 '12 20:04 francoisneron