Robin Ward
7b45a5ce55
FIX: Better and more secure validation of periods for TopicQuery
...
Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
2021-07-23 14:24:44 -04:00
Krzysztof Kotlarek
427d54b2b0
DEV: Upgrading Discourse to Zeitwerk ( #8098 )
...
Zeitwerk simplifies working with dependencies in dev and makes it easier reloading class chains.
We no longer need to use Rails "require_dependency" anywhere and instead can just use standard
Ruby patterns to require files.
This is a far reaching change and we expect some followups here.
2019-10-02 14:01:53 +10:00
Sam Saffron
30990006a9
DEV: enable frozen string literal on all files
...
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.
Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00
Guo Xiang Tan
152238b4cf
DEV: Prefer `public_send` over `send`.
2019-05-07 09:33:21 +08:00
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
Guo Xiang Tan
b889bfefbb
PERF: Don't calculate the same query twice.
2016-11-24 14:05:26 +08:00
Guo Xiang Tan
857955dd04
Follow our convention of declaring private methods.
2016-11-24 10:26:39 +08:00
Guo Xiang Tan
f812415c52
Update annotations.
2016-11-24 10:13:03 +08:00
Arpit Jalan
1cee914565
FEATURE: make top criteria formula multipliers controlled by site
...
setting
2016-01-21 10:30:06 +05:30
Arpit Jalan
97e4f7f6d3
Enums that are used in tables need to be stable
2016-01-08 20:43:11 +05:30
Régis Hanol
fe656fb04d
FIX: select appropriate period when redirecting to top
2015-09-21 20:28:20 +02:00
Neil Lalonde
7518918b8f
FEATURE: add quarterly period to Top page
2015-07-28 12:31:42 -04:00
Sam
2a586d59e9
FEATURE: top topics all time
...
tweak top algorithm (we will continue next week)
2015-03-06 18:00:29 +11:00
Régis Hanol
7edb88a5a8
FIX: change top score formula
...
Adds more weight to `likes` (it's now the same weight as `post_count`)
2014-12-03 11:51:49 +01:00
Akshay
378bc6e5dc
private methods need to be called as method_name instead of ClassName#method_name
2014-10-04 09:53:46 +05:30
Akshay
9524b514c6
Fix access specifiers with private_class_methods instead of removing directly
2014-10-04 09:20:41 +05:30
Akshay
9d11ccc42e
removed usless access modifiers specified in models
2014-08-19 07:28:21 +05:30
Régis Hanol
a62968c846
FIX: actually compute top score for 'older' periods
2014-08-12 19:42:46 +02:00
Sam
cb0ecd9ff1
PERF: store topic views in a topic view table
...
* cut down on storage of the work Topic, 3 times per row (in 2 indexes)
* only store one view per user per topic
* only store one view per ip per topic
2014-08-04 19:07:55 +10:00
Robin Ward
0a2036a99a
OPTIMIZATION: Don't run 12 queries every 15 mins for the Top section.
...
Instead, run the daily queries once every hour, and the reset of the
queries once a day.
2014-08-01 16:25:20 -04:00
Régis Hanol
f20fba041c
BUGFIX: improved top ranking formula (+ filter topics based on their creation date)
2014-05-05 23:05:35 +02:00
Régis Hanol
6373de550f
update annotations
2014-04-08 17:35:44 +02:00
Sam
b7ff4173c9
BUGFIX: mitigate unbound table growth on top_topics
2014-03-27 15:43:24 +11:00
Régis Hanol
084f51b013
FEATURE: do not show category definition topic on top pages
2014-03-07 12:02:52 +01:00
Régis Hanol
6b83ed0347
OPTIM: change Top Topic's score computation algorithm
...
New algorithm will not wipe the entire table anymore and will only remove
invisible topics and add new visible topics.
2014-02-28 20:33:52 +01:00
Sam
be560d4eb6
Update annotations
2014-02-07 11:07:52 +11:00
Régis Hanol
871adc0b0f
BUGFIX: Top page wasn't display any topics
2014-01-07 00:37:14 +01:00
Régis Hanol
fd36fa1c2f
make sure we do not count system user's posts
2014-01-03 17:27:55 +01:00
Régis Hanol
2cecc0b21f
make sure we only count regular posts when calculating Top score
2014-01-03 16:56:03 +01:00
Régis Hanol
28bf78d801
BUGFIX: make sure we only show topics that have a useful score in the Top page
2014-01-03 09:15:10 +01:00
Régis Hanol
edc154251d
FEATURE: improve the TOP page scoring formula a bit
2014-01-02 22:38:35 +01:00
Neil Lalonde
1781b290cb
Fix top_topic.rb to be compatible with ruby 1.9
2013-12-27 16:16:25 -05:00
Régis Hanol
b5a59c10d5
let's try another formula for the top tab
2013-12-27 19:12:53 +01:00
Régis Hanol
9c8e50351d
first stab at calculating the score of a topic for the top tab
2013-12-27 18:10:35 +01:00
Régis Hanol
567d2bd23c
add top page
2013-12-24 00:50:36 +01:00