Skip to content

Instantly share code, notes, and snippets.

@wdiechmann
Created October 25, 2012 15:57
Show Gist options
  • Save wdiechmann/3953633 to your computer and use it in GitHub Desktop.
Save wdiechmann/3953633 to your computer and use it in GitHub Desktop.
Could I have stumpled upon a bug in ActionPack, hmmm??!?
[7] pry(#<Messages::DistributionListsController>)> options
=> {}
[8] pry(#<Messages::DistributionListsController>)> args = record_or_hash_or_array.dup
=> ["messages",
#<Messages::DistributionList id: nil, ox_id: nil, user_id: nil, name: nil, active: nil, created_at: nil, updated_at: nil>]
[9] pry(#<Messages::DistributionListsController>)> inflection = :singular
=> :singular
[10] pry(#<Messages::DistributionListsController>)> args.delete_if {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
=> [#<Messages::DistributionList id: nil, ox_id: nil, user_id: nil, name: nil, active: nil, created_at: nil, updated_at: nil>]
[11] pry(#<Messages::DistributionListsController>)> args
=> [#<Messages::DistributionList id: nil, ox_id: nil, user_id: nil, name: nil, active: nil, created_at: nil, updated_at: nil>]
[12] pry(#<Messages::DistributionListsController>)> build_named_route_call(record_or_hash_or_array, inflection, options)
=> "messages_messages_distribution_list_url"
[13] pry(#<Messages::DistributionListsController>)> build_named_route_call(args, inflection, options)
=> "messages_distribution_list_url"
[14] pry(#<Messages::DistributionListsController>)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment