Commit Graph

6 Commits

Author SHA1 Message Date
Sam 5f64fd0a21 DEV: remove exec_sql and replace with mini_sql
Introduce new patterns for direct sql that are safe and fast.

MiniSql is not prone to memory bloat that can happen with direct PG usage.
It also has an extremely fast materializer and very a convenient API

- DB.exec(sql, *params) => runs sql returns row count
- DB.query(sql, *params) => runs sql returns usable objects (not a hash)
- DB.query_hash(sql, *params) => runs sql returns an array of hashes
- DB.query_single(sql, *params) => runs sql and returns a flat one dimensional array
- DB.build(sql) => returns a sql builder

See more at: https://github.com/discourse/mini_sql
2018-06-19 16:13:36 +10:00
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Louis Rose 1574485443 Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
2014-05-06 14:41:59 +01:00
Neil Lalonde 7780013c3a Seed categories in transactions 2014-03-19 12:00:13 -04:00
Neil Lalonde 99285f73e7 FIX: don't try to create category description topic if it already exists 2014-03-14 10:26:17 -04:00
Neil Lalonde ec7ef21403 Add a Staff category. Have a topic for assets in the Staff category. Move admin quick start guide to Staff category. Quick start guide is not invisible anymore. 2014-02-27 17:38:20 -05:00