rethinkdb-example-sinatra-pastie icon indicating copy to clipboard operation
rethinkdb-example-sinatra-pastie copied to clipboard

Code improvements

Open aderyabin opened this issue 10 years ago • 5 comments

This PR hasn't big functionality changes. Only code style improvements and fix messages.

aderyabin avatar Dec 03 '14 23:12 aderyabin

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 avatar Dec 18 '14 19:12 danielmewes

@danielmewes Done!

aderyabin avatar Dec 18 '14 20:12 aderyabin

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.

mlucy avatar Dec 20 '14 03:12 mlucy

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 avatar Jan 14 '15 00:01 mlucy

@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 .

danielmewes avatar Jan 14 '15 00:01 danielmewes