{"action":"closed","issue":{"url":"https://api.github.com/repos/balvig/spyke/issues/45","labels_url":"https://api.github.com/repos/balvig/spyke/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/balvig/spyke/issues/45/comments","events_url":"https://api.github.com/repos/balvig/spyke/issues/45/events","html_url":"https://github.com/balvig/spyke/issues/45","id":69101186,"number":45,"title":"Inspect is broken in some cases","user":{"login":"jontebol","id":87823,"avatar_url":"https://avatars.githubusercontent.com/u/87823?v=3","gravatar_id":"","url":"https://api.github.com/users/jontebol","html_url":"https://github.com/jontebol","followers_url":"https://api.github.com/users/jontebol/followers","following_url":"https://api.github.com/users/jontebol/following{/other_user}","gists_url":"https://api.github.com/users/jontebol/gists{/gist_id}","starred_url":"https://api.github.com/users/jontebol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jontebol/subscriptions","organizations_url":"https://api.github.com/users/jontebol/orgs","repos_url":"https://api.github.com/users/jontebol/repos","events_url":"https://api.github.com/users/jontebol/events{/privacy}","received_events_url":"https://api.github.com/users/jontebol/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-17T09:20:32Z","updated_at":"2015-04-17T16:11:02Z","closed_at":"2015-04-17T16:11:02Z","body":"Fred and his owner are back! ;) It's actually not inspect that is broken, but something is up with uri and inspect_attributes. This bit me while I was fooling around in a rails console, because the rails console apparently does ```inspect ``` on the return value of every command you enter and suddenly I was getting unexplainable ``` Spyke::InvalidPathError ``` s.\r\n\r\nFred is the broken dog in the following example:\r\n```ruby\r\nclass Owner < Spyke::Base; has_many :dogs; end; class Dog < Spyke::Base; belongs_to :owner, uri: \"owner/:id\"; end\r\n\r\nfred = Dog.new\r\nfred.build_owner\r\n\r\nfred.owner.uri\r\n# <Spyke::Path:0x000001022d9be8 @params={:id=>nil}, @pattern=\"owner/:id\">\r\nfred.inspect\r\n# Spyke::InvalidPathError: Missing required params: id in owner/:id. Mark optional params with parens eg: (:param)\r\nfred.send(:inspect_attributes)\r\n# Spyke::InvalidPathError: Missing required params: id in owner/:id. Mark optional params with parens eg: (:param)\r\n\r\nted = Dog.new(owner: Owner.new)\r\n\r\nted.owner.uri\r\n# <Spyke::Path:0x00000102249228 @params={}, @pattern=\"owners/(:id)\">\r\nted.inspect\r\n# \"#<Dog(dogs) id: nil owner: #<Owner(owners) id: nil >>\"\r\nted.send(:inspect_attributes)\r\n# \"owner: #<Owner(owners) id: nil >\"\r\n```\r\n\r\nAs usual, I may be missing something, but it really seems to me that ```fred = Dog.new; fred.build_owner```would be equivalent to ``` fred = Dog.new(owner: Owner.new) ```. And of course that inspect should never raise an error... ;)"}}