{"action":"created","issue":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/18","labels_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/18/comments","events_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/18/events","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/18","id":12322234,"number":18,"title":"Contracts polluting rails console","user":{"login":"mcandre","id":5316,"avatar_url":"https://avatars.githubusercontent.com/u/5316?v=3","gravatar_id":"","url":"https://api.github.com/users/mcandre","html_url":"https://github.com/mcandre","followers_url":"https://api.github.com/users/mcandre/followers","following_url":"https://api.github.com/users/mcandre/following{/other_user}","gists_url":"https://api.github.com/users/mcandre/gists{/gist_id}","starred_url":"https://api.github.com/users/mcandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcandre/subscriptions","organizations_url":"https://api.github.com/users/mcandre/orgs","repos_url":"https://api.github.com/users/mcandre/repos","events_url":"https://api.github.com/users/mcandre/events{/privacy}","received_events_url":"https://api.github.com/users/mcandre/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2013-03-22T14:53:45Z","updated_at":"2015-01-21T12:40:32Z","closed_at":null,"body":"I'm trying to integrate a robust contract-ified gem into a new Rails app.\r\n\r\nI added my gem as a dependency in the Rails app's `Gemspec`. I generated a scaffold for Employees. I can successfully create new employees using the Rails web interface. But when I try to use `rails console`, somehow Contracts interferes. When I remove the contract-ified gem as a dependency in the Rails app's `Gemspec`, the error goes away. And strangely, the error only presents in the `rails console` interface. Everything working okay in the Rails web interface.\r\n\r\nTrace:\r\n\r\n\t$ rails console\r\n\tLoading development environment (Rails 3.2.13)\r\n\tirb(main):001:0> Employee.create :name => \"Andrew Pennebaker, :github_username => \"mcandre\"\r\n\tRuntimeError: Couldn't find decorator for method Class:qualified_const_defined?.\r\n\tDoes this method look correct to you? If you are using contracts from rspec, rspec wraps classes in\r\n\tit's own class.\r\n\tLook at the specs for contracts.ruby as an example of how to write contracts in this case.\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/contracts-0.2.1/lib/decorators.rb:57:in `qualified_const_defined?'\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-.2.13/lib/active_support/dependencies.rb:378:in `qualified_const_defined?'\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-.2.13/lib/active_support/dependencies.rb:490:in `load_missing_constant'\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-.2.13/lib/active_support/dependencies.rb:192:in `block in const_missing'\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-.2.13/lib/active_support/dependencies.rb:190:in `each'\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-.2.13/lib/active_support/dependencies.rb:190:in `const_missing'\r\n    from (irb):1\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-.2.13/lib/rails/commands/console.rb:47:in\r\n\t`start'\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-.2.13/lib/rails/commands/console.rb:8:in\r\n\t`start'\r\n    from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'\r\n    from script/rails:6:in `require'\r\n    from script/rails:6:in `<main>'\r\n\r\nSystem:\r\n\r\n\t$ specs rails ruby os\r\n\tSpecs:\r\n\r\n\tspecs 0.2\r\n\thttps://github.com/mcandre/specs#readme\r\n\r\n\trails --version\r\n\tRails 3.2.13\r\n\r\n\tgem --version\r\n\t2.0.3\r\n\r\n\truby --version\r\n\truby 1.9.3p374 (2013-01-15) [i386-mingw32]\r\n\r\n\tsysteminfo | findstr /B /C:\"OS Name\" /C:\"OS Version\"\r\n\tOS Name:                   Microsoft Windows XP Professional\r\n\tOS Version:                5.1.2600 Service Pack 3 Build 2600\r\n\r\nI suspect that some of the toplevel `include Contract` magic is colliding with Rails."},"comment":{"url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/comments/70829794","html_url":"https://github.com/egonSchiele/contracts.ruby/issues/18#issuecomment-70829794","issue_url":"https://api.github.com/repos/egonSchiele/contracts.ruby/issues/18","id":70829794,"user":{"login":"filib","id":802389,"avatar_url":"https://avatars.githubusercontent.com/u/802389?v=3","gravatar_id":"","url":"https://api.github.com/users/filib","html_url":"https://github.com/filib","followers_url":"https://api.github.com/users/filib/followers","following_url":"https://api.github.com/users/filib/following{/other_user}","gists_url":"https://api.github.com/users/filib/gists{/gist_id}","starred_url":"https://api.github.com/users/filib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filib/subscriptions","organizations_url":"https://api.github.com/users/filib/orgs","repos_url":"https://api.github.com/users/filib/repos","events_url":"https://api.github.com/users/filib/events{/privacy}","received_events_url":"https://api.github.com/users/filib/received_events","type":"User","site_admin":false},"created_at":"2015-01-21T12:40:32Z","updated_at":"2015-01-21T12:40:32Z","body":"@waterlink Would this mean that doing `include Contracts` in an `irb` session would show the deprecation (and eventually raise an error in `1.0`)?"}}