docbrown/app
rhymes c989cbf301 Super small queries optimizations (#1586)
* Replace find_by().nil? with exists?

find_by asks the DB and the ORM to load the entire object in memory, then it is discarded just know if it exists or not. Exists will just return true or false

* Use present? in lieu of any? when it is proper

A request for any? followed by each in a most likely full collection results in two SQL queries. present? preloads the objects, so it results in one single connection because the objects are already in memory.
2019-01-19 17:28:02 -05:00
..
assets Remove unnecessary CSS property (#1581) 2019-01-17 12:22:24 -05:00
black_box Improve feed and add more randomness (#1570) 2019-01-16 16:01:14 -05:00
controllers Update twitter validation and internal/articles query (#1571) 2019-01-16 17:15:22 -05:00
dashboards Rubocop cleanups (#1415) 2019-01-02 11:20:02 -05:00
decorators Rubocop cleanups (#1415) 2019-01-02 11:20:02 -05:00
fields Fix URL Validations and Update Admin Dashboard (#1392) 2018-12-26 18:00:02 -05:00
helpers Removed bug reports from app (#1565) 2019-01-16 11:28:59 -05:00
javascript Cleanup Image management file (#1390) 2018-12-26 16:19:04 -05:00
labor Update twitter validation and internal/articles query (#1571) 2019-01-16 17:15:22 -05:00
lib Rubocop cleanups (#1415) 2019-01-02 11:20:02 -05:00
liquid_tags Jsfiddle LiquidTag (#1509) 2019-01-17 15:44:01 -05:00
mailers Replace data with content in export email copy (#1572) 2019-01-16 17:10:06 -05:00
models Replace each with find_each for AR queries (#1557) 2019-01-15 16:38:03 -05:00
observers Rubocop cleanups (#1415) 2019-01-02 11:20:02 -05:00
policies Update dashboard_show admin permissions (#1496) 2019-01-08 17:46:31 -05:00
sanitizers Feature/more markdown tags (#826) 2018-10-04 19:02:55 -04:00
services Improve feed and add more randomness (#1570) 2019-01-16 16:01:14 -05:00
uploaders Code cleanups (#659) 2018-08-07 11:00:13 -04:00
views Super small queries optimizations (#1586) 2019-01-19 17:28:02 -05:00