rethinkdb-example-sinatra-pastie
rethinkdb-example-sinatra-pastie copied to clipboard
Code improvements
This PR hasn't big functionality changes. Only code style improvements and fix messages.
Thanks a lot for your pull requests @aderyabin! Unless you have already done so, can you please sign our contributor agreement http://rethinkdb.com/community/cla/ ?
@mlucy Can you take a look?
@danielmewes Done!
Sorry I haven't gotten a chance to look at this yet @aderyabin . The holidays are making my schedule pretty hectic, but I'll try to get to it soon.
Alright, I'm back from vacation and finally got to this!
The changes look good, except for the changes like r.table('test') to r.table(:test). The former reads much better to me. 'test' isn't the name of a field in a hash, it's just the name of something, and it's a little weird to have it be a symbol in that context. I'm torn on whether or not to make the arguments to e.g. pluck be symbols or strings, since they are field names, but I'm leaning toward strings there too just for consistency and because it prevents people from making errors (e.g. r.table('test').get(0)[:foo].run() works but r.table('test').get(0).run()[:foo] doesn't (but r.table('test').get(0).run()['foo'] does)).
If the symbols used in queries change to strings, I'm on board with these changes.
@danielmewes -- who wrote this code originally? They should probably double-check this too.
@mlucy It seems @al3xandru did, so that might be difficult. @chipotle and @mglukhovsky have both done smaller maintenance since then https://github.com/rethinkdb/rethinkdb-example-sinatra-pastie/commits/master .