ianwhite / resources_controller

resources_controller rails plugin: rc makes RESTful controllers fun
MIT License
79 stars 21 forks source link

Stop modifying resource_specification_map in place #8

Closed mocoso closed 12 years ago

mocoso commented 12 years ago

Because this is a class attribute and modifying it in place will change the map for ALL controllers not just the one you call map_enclosing_resource in.

This bug was introduced in commit 292c96986f1da6803b2826354d488eeb269da4d5

ianwhite commented 12 years ago

Thanks for this, am on holidays ATM will pull and release a new version shortly.

Cheers, Ian

Sent from my iPhone

On 4 May 2012, at 17:29, Joel Chippindalereply@reply.github.com wrote:

Because this is a class attribute and modifying it in place will change the map for ALL controllers not just the one you call map_enclosing_resource in.

This bug was introduced in commit 292c96986f1da6803b2826354d488eeb269da4d5

You can merge this Pull Request by running:

git pull https://github.com/econsultancy/resources_controller class-attribute-fix

Or you can view, comment on it, or merge it online at:

https://github.com/ianwhite/resources_controller/pull/8

-- Commit Summary --

  • Stop modifying resource_specification_map in place

-- File Changes --

M lib/resources_controller.rb (2)

-- Patch Links --

https://github.com/ianwhite/resources_controller/pull/8.patch https://github.com/ianwhite/resources_controller/pull/8.diff


Reply to this email directly or view it on GitHub: https://github.com/ianwhite/resources_controller/pull/8

ianwhite commented 12 years ago

Hi Joel,

Thanks for this, it's in master now. There's some failing tests that I've noticed (not to do with this change). When they are fixed I'll release 2.1.1.

Cheers, Ian

On 4 May 2012, at 08:29, Joel Chippindale wrote:

Because this is a class attribute and modifying it in place will change the map for ALL controllers not just the one you call map_enclosing_resource in.

This bug was introduced in commit 292c96986f1da6803b2826354d488eeb269da4d5

You can merge this Pull Request by running:

git pull https://github.com/econsultancy/resources_controller class-attribute-fix

Or you can view, comment on it, or merge it online at:

https://github.com/ianwhite/resources_controller/pull/8

-- Commit Summary --

  • Stop modifying resource_specification_map in place

-- File Changes --

M lib/resources_controller.rb (2)

-- Patch Links --

https://github.com/ianwhite/resources_controller/pull/8.patch https://github.com/ianwhite/resources_controller/pull/8.diff


Reply to this email directly or view it on GitHub: https://github.com/ianwhite/resources_controller/pull/8