{"comment":{"created_at":"2011-10-20T12:59:23Z","body":"Here is a patch\r\n\r\n    diff --git a/lib/cucumber/constantize.rb b/lib/cucumber/constantize.rb\r\n    index 7917390..7b61652 100644\r\n    --- a/lib/cucumber/constantize.rb\r\n    +++ b/lib/cucumber/constantize.rb\r\n    @@ -11,7 +11,7 @@ module Cucumber\r\n             names.each do |name|\r\n               constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)\r\n             end\r\n    -        constant\r\n    +        eval(camel_cased_word)\r\n           rescue NameError => e\r\n             require underscore(camel_cased_word)\r\n             if try < 2\r\n","updated_at":"2011-10-20T12:59:23Z","url":"https://api.github.com/repos/cucumber/cucumber/issues/comments/2468271","id":2468271,"user":{"avatar_url":"https://secure.gravatar.com/avatar/968fba3ba6e5df2df68a458218be7104?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"968fba3ba6e5df2df68a458218be7104","url":"https://api.github.com/users/jarl-dk","id":191521,"login":"jarl-dk"}},"action":"created","issue":{"number":158,"created_at":"2011-10-20T12:58:09Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"On a rails project I use cucumber. We have a model named Usage.\r\n\r\nWhen I run\r\n\r\n    cucumber -f usage\r\nit fails because constantize returns the constanct `Usage` and without the constant being fully qualified, it evaluates to the one that derives from ActiveRecord. The result is\r\n\r\n    $ bundle exec cucumber -f usage\r\n    Using the default profile...\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_\r\n    wrong number of arguments (3 for 2)\r\n    Error creating formatter: usage (ArgumentError)\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/base.rb:1549:in `initialize'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/cli/configuration.rb:168:in `new'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/cli/configuration.rb:168:in `block in formatters'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/cli/configuration.rb:163:in `map'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/cli/configuration.rb:163:in `formatters'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/cli/configuration.rb:68:in `build_tree_walker'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/runtime.rb:42:in `run!'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/cli/main.rb:43:in `execute!'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/lib/cucumber/cli/main.rb:20:in `execute'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-1.1.0/bin/cucumber:14:in `<top (required)>'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/bin/cucumber:19:in `load'\r\n    /home/jarl/.rvm/gems/ruby-1.9.2-p290/bin/cucumber:19:in `<main>'\r\n\r\nOne resolution is to make constantize return the fully qualified constant, I will provide a patch.\r\n\r\nYou can reproduce by creating a rails project and use cucumber-rails and create a model named Usage, then run\r\n\r\n    bundle exec cucumber -f usage\r\n","comments":1,"title":"cucumber v 1.1.0 fails when used on a rails project with model named Usage","updated_at":"2011-10-20T12:59:23Z","url":"https://api.github.com/repos/cucumber/cucumber/issues/158","id":2004424,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/968fba3ba6e5df2df68a458218be7104?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"968fba3ba6e5df2df68a458218be7104","url":"https://api.github.com/users/jarl-dk","id":191521,"login":"jarl-dk"},"html_url":"https://github.com/cucumber/cucumber/issues/158","labels":[],"state":"open"},"legacy":{"issue_id":2004424,"comment_id":2468271}}