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

Support namespacing in Hash.to_param #175

Merged
merged 1 commit into from May 29, 2011
Merged

Conversation

@recurser
Copy link
Contributor

@recurser recurser commented May 29, 2011

Hi,

Using CanCan for Ripple::Document authorization seems to rely on namespacing in Hash.to_param, and including the CanCan gem breaks a lot of the rspec controller tests.

Using the activesupport to_param implementation fixes this.

Thanks for your hard work on Ripple!

Failure/Error: post :create, "object"=>"user", "entry"=>[{"uid"=>"551787304", "id"=>"551787304", "time"=>1305105927, "changed_fields"=>["likes"]}]
ArgumentError:
 wrong number of arguments (1 for 0)
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/riak-client-0.9.4/lib/riak/core_ext/to_param.rb:25:in `to_param'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/activesupport-3.0.7/lib/active_support/core_ext/object/to_query.rb:21:in `block in to_query'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/activesupport-3.0.7/lib/active_support/core_ext/object/to_query.rb:21:in `collect'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/activesupport-3.0.7/lib/active_support/core_ext/object/to_query.rb:21:in `to_query'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/riak-client-0.9.4/lib/riak/core_ext/to_param.rb:31:in `block in to_param'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/riak-client-0.9.4/lib/riak/core_ext/to_param.rb:30:in `each'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/riak-client-0.9.4/lib/riak/core_ext/to_param.rb:30:in `map'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/riak-client-0.9.4/lib/riak/core_ext/to_param.rb:30:in `to_param'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/actionpack-3.0.7/lib/action_controller/test_case.rb:167:in `assign_parameters'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/actionpack-3.0.7/lib/action_controller/test_case.rb:402:in `process'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/actionpack-3.0.7/lib/action_controller/test_case.rb:47:in `process'
# /Users/dave/.rvm/gems/ruby-1.9.2-p0@rails3/gems/actionpack-3.0.7/lib/action_controller/test_case.rb:355:in `post'
# ./spec/controllers/subscription_notifications_controller_spec.rb:17:in `block (2 levels) in <top (required)>'
@seancribbs
Copy link
Contributor

@seancribbs seancribbs commented May 29, 2011

Looks good. I prefer map over collect but that's just my Erlang experience coming out.

seancribbs added a commit that referenced this issue May 29, 2011
Support namespacing in Hash.to_param
@seancribbs seancribbs merged commit a43be2f into riak-ripple:master May 29, 2011
@recurser
Copy link
Contributor Author

@recurser recurser commented May 29, 2011

Thanks - I just copied the collect from activesupport, use map by all means if you'd prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants