davetapley / arbiter-back Goto Github PK
View Code? Open in Web Editor NEWConditionally translate URLs to redirect or serve content
Conditionally translate URLs to redirect or serve content
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.