Commit Graph

21 Commits

Author SHA1 Message Date
evazion
59b277ead1 users: drop id_to_name, name_to_id caching.
Changes:

* Drop Users.id_to_name.
* Don't cache Users.name_to_id.
* Replace calls to name_to_id with find_by_name when possible.
* Don't autodefine creator_name in belongs_to_creator.
* Don't autodefine updater_name in belongs_to_updater.
* Instead manually define creator_name / updater_name only on models that need
  to return these fields in the api.

id_to_name was cached to reduce the impact of N+1 query patterns in
certain places, especially in api responses that return creator_name /
updater_name fields. But it still meant we were doing N calls to
memcache. Using `includes` to prefetch users avoids this N+1 pattern.

name_to_id had no need be cached, it was never used in any performance-
sensitive contexts.

Avoiding caching also avoids the need to keep these caches consistent.
2019-08-18 11:24:42 -05:00
evazion
0c6d9f60bd Remove unused mailers. 2019-08-06 10:42:45 -05:00
evazion
604bfb0923 Fix #3846: Subscribed forum posts link to invalid URL in email updates.
Test: http://localhost/rails/mailers/user_mailer/forum_notice
2018-08-27 22:04:37 -05:00
Albert Yi
664a3f02e2 fixes for failed cron maintenance tasks
* update rails scripts for 5.2
* system dmails should be scoped to system
* fix broken url generator in forum notices
2018-04-27 15:01:40 -07:00
evazion
7cb7c2fbab Remove ruby DText implementation (#3206). 2017-07-19 16:48:42 -05:00
evazion
17d4feaf15 dmail_notice.html.erb: use absolute urls in dtext links. 2017-02-18 03:11:35 -06:00
Albert Yi
87bcc07fae enable ragel parser for remaining dtext endpoints 2017-01-10 15:12:37 -08:00
r888888888
4c5e7a2708 fixes #2478: Add links for easy opt-out of emails 2015-09-03 17:03:03 -07:00
r888888888
341b29ce41 fix tests 2015-08-18 17:40:53 -07:00
r888888888
652db511ac better formatting for forum update emails 2015-02-15 13:03:46 -08:00
r888888888
2b96040a30 fixes #2191 2014-08-12 17:03:16 -07:00
r888888888
74aecae694 fix dmail test 2014-02-03 12:56:55 -08:00
Toks
d49571226c #2093: Parse dtext 2014-01-22 20:06:05 -05:00
r888888888
d5f575159f rename references of privileged to gold 2013-04-28 00:04:52 -07:00
albert
bf44bbb112 fixes #702 2013-03-02 22:22:57 -05:00
albert
aea7f938b8 style fixes 2012-09-21 16:34:21 -04:00
albert
4baf5be7a2 added upgrade mailer 2011-12-02 16:46:37 -05:00
albert
1e9efe65f4 updated mailer urls 2011-09-18 17:12:48 -04:00
albert
90a41a334b separated pool/post updates; fixed unit tests 2011-03-13 17:49:34 -04:00
albert
9e7efbd295 stubbed in view code from old danbooru; only janitors can lock a wiki page 2011-02-28 14:18:39 -05:00
albert
0bb52fd63a added dmail test 2010-02-20 18:08:22 -05:00