Git Product home page Git Product logo

arbiter-back's People

Contributors

davetapley avatar

arbiter-back's Issues

404 when updating an a domain's root path

It looks like this:

2015-10-14T19:09:25.333945+00:00 heroku[router]: at=info method=PUT path="/tokens/www.psp.bike%2C" host=arbiter-back-production.herokuapp.com request_id=42c087da-d65b-474a-b1ad-26ea11a6cbf8 fwd="108.161.181.118,54.92.165.235" dyno=web.1 connect=0ms service=62ms status=404 bytes=306
2015-10-14T19:09:25.306248+00:00 app[web.1]: Started PUT "/tokens/www.psp.bike%2C" for 54.92.165.235 at 2015-10-14 19:09:25 +0000
2015-10-14T19:09:25.329280+00:00 app[web.1]: 
2015-10-14T19:09:25.329285+00:00 app[web.1]: ActiveRecord::RecordNotFound (Couldn't find Token with 'domain_id,path_id'=["www.psp.bike"] [WHERE "ownerships"."user_id" = 2]):
2015-10-14T19:09:25.329286+00:00 app[web.1]:   app/controllers/tokens_controller.rb:42:in `update'
2015-10-14T19:09:25.329287+00:00 app[web.1]: 
2015-10-14T19:09:25.329303+00:00 app[web.1]: 
2015-10-14T19:09:25.308635+00:00 app[web.1]: Processing by TokensController#update as JSON
2015-10-14T19:09:25.308671+00:00 app[web.1]:   Parameters: {"token"=>{"translations"=>[{"priority"=>0, "target"=>"www.phoenixspokespeople.org", "rule"=>{"$type"=>"Always"}}]}, "id"=>"www.psp.bike,"}
2015-10-14T19:09:25.327436+00:00 app[web.1]: Completed 404 Not Found in 19ms

Testing on console confirms that find with CPK gem can't handle the 'key is empty string' case:

irb(main):021:0* token = Token.find 'www.psp.bike,'
ActiveRecord::RecordNotFound: Couldn't find Token with 'domain_id,path_id'=["www.psp.bike"]
        from /app/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.8/lib/active_record/relation/finder_methods.rb:320:in `raise_record_not_found_exception!'

By contrast explicit partition / find_by works:

irb(main):022:0> token = Token.find ['www.psp.bike','']
=> #<Token domain_id: "www.psp.bike", path_id: "">

Could be an underlying issue with CPK.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.