Commit Graph

27 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
Sam 1abc276451 FIX: properly omit inactive and silenced users from directory 2017-12-19 12:53:59 +11:00
Sam 7e841a0495 FIX: stop counting PMs, deleted topics and whispers in directory and user stats 2017-11-20 16:44:09 +11:00
Robin Ward 971e302ff2 FEATURE: Support an end date for user silencing 2017-11-14 13:20:19 -05:00
Robin Ward 1f14350220 Rename "Blocked" to "Silenced" 2017-11-10 14:10:27 -05:00
Neil Lalonde ec3d800492 add option to force DirectoryItem.refresh_period! to run even if user directory is disabled 2017-11-10 12:30:22 -05:00
Neil Lalonde ca1609c821 FIX: user directory didn't update stats of users with no recent activity 2017-08-09 15:57:42 -04:00
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Arpit Jalan e03c1e4cdf annotate models 2016-10-31 15:02:11 +05:30
Sam 236d8193bd annotate models 2016-03-28 15:21:45 +11:00
Sam fe684fdfb8 FIX: incorrect stat for topics_entered in user directory 2016-03-10 07:44:16 +11:00
Sam Saffron c15c483931 PERF: stop rebuilding full directory item table on refresh 2016-03-02 18:23:29 +11:00
Sam d0ee32f3ce FIX: correct counts on user summary 2016-01-24 16:39:01 +11:00
Guo Xiang Tan b6eb8f7793 FIX: Wrong period for quarterly reports. 2015-12-07 21:04:34 +08:00
Sam c1ecd6f4ce update annotations 2015-09-18 10:41:10 +10:00
Robin Ward 2d4729782e FIX: Support quarterly on user directory 2015-08-17 13:58:40 -04:00
Robin Ward bb93a345eb UX: Use smaller messages for moderator actions. 2015-07-27 10:09:21 -04:00
Robin Ward a7e6148d40 FIX: Some low activity users were being restricted from the directory. 2015-05-11 11:24:34 -04:00
Robin Ward 6ae58d41a7 PERF: Only refresh the Daily stats hourly, do the others daily. 2015-04-20 12:11:36 -04:00
Tan Le 9fbc763902 Replace Hash#keys.each with Hash#each_key for some perf boost 2015-04-18 21:53:53 +10:00
Robin Ward 2cc5858163 Add site setting to disable User Directory, include restricted info 2015-03-26 11:26:19 -04:00
Robin Ward 1e3e4135a3 Add Posts Read + Visits to User Directory 2015-03-24 15:31:54 -04:00
Robin Ward 3c0fee1786 Fixes broken spec 2015-03-20 13:24:03 -04:00
Robin Ward 605fe4b11d Don't count moderator actions in the user directory stats 2015-03-20 12:14:14 -04:00
Robin Ward 9f22be2865 Restrict User Directory results more based on privacy 2015-03-20 11:42:39 -04:00
Robin Ward 7ef306cd3b A bunch of tweaks to the Users directory
- Move user directory from `/directory` to `/users/`
- Defaults to 'weekly' time period
- Don't include deleted topics/posts in the results
- Move heart icon to header instead of on each row
- "Users" instead of "Users found"
2015-03-19 12:29:38 -04:00
Robin Ward 3d2d224312 FEATURE: User Directory, with sorting and time period filter 2015-03-18 15:20:34 -04:00