discourse/app/models
Guo Xiang Tan 982e3d04f6 PERF: Allow memory to be freed instead of fetching all the objects into memory at once.
```
MemoryProfiler.report do
  Jobs::UserEmail.new.execute(type: :mailing_list, user_id: user.id)
end.pretty_print
```

Before:
```
Total allocated: 180096119 bytes (1962025 objects)
Total retained:  2194 bytes (16 objects)

allocated memory by gem
-----------------------------------
  66979096  activerecord-4.2.8
  43507184  nokogiri-1.7.1
  43365188  mail-2.6.4
   5960201  activesupport-4.2.8
   5056267  discourse/lib
   4835284  rack-mini-profiler-0.10.1
   3825817  arel-6.0.4
   2186088  i18n-0.8.1
   1719330  discourse/app
```

After:
```
Total allocated: 161935975 bytes (1473940 objects)
Total retained:  2234 bytes (17 objects)

allocated memory by gem
-----------------------------------
  45430264  activerecord-4.2.8
  43568627  nokogiri-1.7.1
  43430754  mail-2.6.4
  11233878  rack-mini-profiler-0.10.1
   5260825  activesupport-4.2.8
   5054491  discourse/lib
   2186088  i18n-0.8.1
   1822494  arel-6.0.4
```
2017-05-03 17:01:57 +08:00
..
concerns remove rails-observers 2016-12-22 16:46:53 +11:00
about.rb Add scope for human users. 2017-03-11 14:25:09 +08:00
admin_dashboard_data.rb Use && and || consistently so that there's less chance of copy paste errors in the future 2017-02-15 00:25:49 -08:00
api_key.rb
application_request.rb
auto_track_duration_site_setting.rb
backup.rb FIX: log backups download/destroy staff action 2017-01-16 19:53:31 +01:00
badge_grouping.rb annotate models 2016-02-23 10:33:53 +11:00
badge_type.rb annotate models 2016-02-23 10:33:53 +11:00
badge.rb Change Anniversary badge to be multiple grant, once per year 2017-04-28 14:22:54 -04:00
category_and_topic_lists.rb FEATURE: new 'categories_and_latest' endpoint 2016-08-29 22:47:44 +02:00
category_custom_field.rb
category_featured_topic.rb FEATURE: each category can control how many topics to show on categories page 2017-03-01 15:12:57 -05:00
category_featured_user.rb Support Ruby 2.4. 2017-04-15 12:29:00 +08:00
category_group.rb
category_list.rb FEATURE: each category can control how many topics to show on categories page 2017-03-01 15:12:57 -05:00
category_page_style.rb UX: new 'category_page_style' site setting 2016-08-22 23:01:43 +02:00
category_search_data.rb
category_tag_group.rb annotate models 2016-06-17 11:28:49 +10:00
category_tag.rb annotate models 2016-06-17 11:28:49 +10:00
category_user.rb FIX: Couldn't update category notification level 2016-08-02 11:22:02 -04:00
category.rb Support Ruby 2.4. 2017-04-15 12:29:00 +08:00
child_theme.rb FEATURE: Native theme support 2017-04-12 10:53:49 -04:00
color_scheme_color.rb annotate models 2016-02-23 10:33:53 +11:00
color_scheme.rb FEATURE: default notification level for group messages 2017-04-20 15:47:35 -04:00
custom_emoji.rb Update annotations. 2017-03-22 14:26:53 +08:00
developer.rb missing annotation 2016-08-15 17:59:36 +10:00
digest_email_site_setting.rb FEATURE: More digest email frequency options. Digests can be sent as often as every 30 minutes. 2016-03-02 15:43:47 -05:00
directory_item.rb annotate models 2016-10-31 15:02:11 +05:30
discourse_single_sign_on.rb Add user title to SSO payload 2017-01-31 16:42:27 -08:00
discourse_version_check.rb FEATURE: Installed Version link shows GitHub Compare to branch being followed 2016-08-02 06:18:44 -04:00
draft_sequence.rb Support Ruby 2.4. 2017-04-15 12:29:00 +08:00
draft.rb annotate models 2016-02-23 10:33:53 +11:00
email_change_request.rb FIX: Don't allow invalid email to be saved. 2016-12-21 17:47:11 +08:00
email_log.rb FIX: don't apply max emails per day per user to forgot password 2017-05-03 14:02:37 +05:30
email_token.rb FEATURE: remove email_token_grace_period_hours 2016-12-19 17:15:20 +11:00
embeddable_host.rb FIX: increase host_must_be_valid regex for .technology TLD 2017-04-15 21:06:51 +10:00
embedding.rb FEATURE: Ability to scrub titles when importing embeddable content 2016-08-22 12:43:02 -04:00
emoji_set_site_setting.rb FIX: Emoji update job was not being queued 2016-07-25 12:11:36 -04:00
emoji.rb UX: Order custom emojis by name. 2017-03-30 13:24:18 +08:00
facebook_user_info.rb annotate models 2016-10-31 15:02:11 +05:30
github_user_info.rb annotate models 2016-02-23 10:33:53 +11:00
given_daily_like.rb annotate models 2016-03-28 15:21:45 +11:00
global_setting.rb correct logic, so revalidation is reset 2017-03-13 10:47:43 -04:00
google_user_info.rb annotate models 2016-02-23 10:33:53 +11:00
group_archived_message.rb FEATURE: move_to_inbox and archive_message events 2017-02-28 09:56:41 -05:00
group_custom_field.rb
group_history.rb FEATURE: Group logs. 2016-12-12 17:29:54 +08:00
group_manager.rb
group_mention.rb
group_user.rb FEATURE: default notification level for group messages 2017-04-20 15:47:35 -04:00
group.rb PERF: faster Group.refresh_automatic_group & Group.ensure_consistency 2017-04-24 23:00:21 +02:00
incoming_domain.rb
incoming_email.rb annotate models 2016-05-30 10:45:32 +10:00
incoming_link.rb
incoming_links_report.rb FIX: broken links on admin dashboard in Top Referrers section 2016-02-22 14:31:13 -05:00
incoming_referer.rb
instagram_user_info.rb annotate models 2016-03-28 15:21:45 +11:00
invite_redeemer.rb FIX: always send password reset email when accepting invite if password is not set 2017-04-18 14:37:06 +05:30
invite.rb FIX: rescue specific errors on invite failure 2017-05-02 15:13:33 +05:30
invited_group.rb
like_notification_frequency_site_setting.rb FEATURE: like notification frequency of never 2016-03-06 09:12:59 +11:00
locale_site_setting.rb Add locale step 2016-09-22 09:52:19 -04:00
mailing_list_mode_site_setting.rb FEATURE:'No Echo' option for mailing list mode. 2016-10-19 13:14:36 -04:00
muted_user.rb
new_topic_duration_site_setting.rb
notification_level_when_replying_site_setting.rb FEATURE: Add normal as a preference for topic subscription state when replying to a topic 2017-04-20 22:33:10 -04:00
notification.rb REFACTOR: improve Notification.ensure_consistency SQL query readability 2017-04-24 23:00:27 +02:00
oauth2_user_info.rb annotate models 2016-02-23 10:33:53 +11:00
onceoff_log.rb annotate models 2016-05-30 10:45:32 +10:00
optimized_image.rb Fix broken optimize image command. 2017-03-20 15:07:38 +08:00
permalink.rb
plugin_store_row.rb annotate models 2016-02-23 10:33:53 +11:00
plugin_store.rb Support Ruby 2.4. 2017-04-15 12:29:00 +08:00
post_action_type.rb remove rails-observers 2016-12-22 16:46:53 +11:00
post_action.rb FIX: Copy post actions when moving a topic. 2017-04-06 12:16:22 +08:00
post_analyzer.rb Convert front end paths from /users/ to /u/ 2017-03-30 10:23:24 -04:00
post_custom_field.rb
post_detail.rb annotate models 2016-02-23 10:33:53 +11:00
post_mover.rb PostReply doesn't have a primary key, so no luck here 2017-04-24 23:14:01 +02:00
post_reply.rb FIX: Update post replies when we move posts. (#4324) 2016-07-13 17:34:21 +02:00
post_revision.rb remove rails-observers 2016-12-22 16:46:53 +11:00
post_search_data.rb annotate models 2016-02-23 10:33:53 +11:00
post_stat.rb
post_timing.rb
post_upload.rb Update annotations. 2016-11-24 10:13:03 +08:00
post.rb PERF: Allow memory to be freed instead of fetching all the objects into memory at once. 2017-05-03 17:01:57 +08:00
previous_replies_site_setting.rb FEATURE: allow users to control how many previous replies they get 2016-02-19 13:57:07 +11:00
queued_post.rb FIX: Polls permanently broken if post requires approval. 2017-01-26 13:29:43 +08:00
quoted_post.rb FIX: don't raise exception when a quote was already extracted 2016-11-30 17:18:34 +01:00
remote_theme.rb Refactor theme fields so they support custom theme defined vars 2017-05-02 16:02:14 -04:00
report.rb FIX: Don't show category options for reports that can't be scoped to a category. 2017-04-13 17:10:55 +08:00
rtl.rb Add initial Urdu support with RTL direction 2016-12-03 23:17:51 -05:00
s3_region_site_setting.rb FEATURE: Add AWS S3 EU (London) "eu-west-2" region 2017-04-12 10:38:17 -04:00
scheduler_stat.rb purge scheduler_stats every 1 month instead of 3 2017-04-28 15:05:15 -07:00
screened_email.rb annotate models 2016-02-23 10:33:53 +11:00
screened_ip_address.rb SECURITY: Possible SQL injection. 2016-07-18 15:35:41 +08:00
screened_url.rb annotate models 2016-02-23 10:33:53 +11:00
single_sign_on_record.rb annotate models 2016-10-31 15:02:11 +05:30
site_setting.rb PERF: Don't calculate the same query twice. 2016-11-24 14:05:26 +08:00
site.rb FIX: Associate category logo and background to uploads record. 2016-12-12 17:37:28 +08:00
slug_setting.rb
stylesheet_cache.rb FEATURE: Native theme support 2017-04-12 10:53:49 -04:00
tag_group_membership.rb annotate models 2016-06-17 11:28:49 +10:00
tag_group.rb annotate models 2016-06-17 11:28:49 +10:00
tag_user.rb FEATURE: improved tag and category watching and tracking 2016-07-08 12:58:30 +10:00
tag.rb FIX: Tags used only on deleted topics could not be used again 2016-10-28 15:11:50 -04:00
theme_field.rb Refactor theme fields so they support custom theme defined vars 2017-05-02 16:02:14 -04:00
theme.rb Refactor theme fields so they support custom theme defined vars 2017-05-02 16:02:14 -04:00
top_lists.rb
top_menu_item.rb
top_topic.rb PERF: Don't calculate the same query twice. 2016-11-24 14:05:26 +08:00
topic_allowed_group.rb
topic_allowed_user.rb
topic_converter.rb FIX: Private message can be set to publish in the future. 2017-04-11 20:44:25 +08:00
topic_custom_field.rb annotate models 2016-05-30 10:45:32 +10:00
topic_embed.rb FIX: make TopicEmbed trashable 2017-04-25 18:40:39 +05:30
topic_featured_users.rb FIX: If posts are deleted they should be updated in consistency jobs 2016-06-21 13:05:56 -04:00
topic_invite.rb
topic_link_click.rb FIX: Support links with google analytics tracking and hashes 2016-08-23 12:13:31 -04:00
topic_link.rb just checking for existence is enough here 2016-11-30 23:41:07 +01:00
topic_list.rb FIX: N+1 in topic_list 2017-02-22 12:20:50 -05:00
topic_notifier.rb
topic_participants_summary.rb FEATURE: primary group class on avatars in topic list 2017-02-20 15:55:10 -05:00
topic_poster.rb FEATURE: primary group class on avatars in topic list 2017-02-20 15:55:10 -05:00
topic_posters_summary.rb FEATURE: primary group class on avatars in topic list 2017-02-20 15:55:10 -05:00
topic_status_update.rb FIX: Don't enqueue topic status update job if topic is deleted. 2017-04-13 12:02:35 +08:00
topic_tag.rb annotate models 2016-05-30 10:45:32 +10:00
topic_tracking_state.rb FIX: whisper no longer experimental 2016-12-02 17:03:31 +11:00
topic_user.rb use notification_levels methods for specifying normal notification level 2017-04-19 16:17:24 +05:30
topic_view_item.rb Update annotations. 2017-03-22 14:26:53 +08:00
topic.rb FIX: rescue specific errors on invite failure 2017-05-02 15:13:33 +05:30
translation_override.rb annotate models 2016-05-30 10:45:32 +10:00
trust_level_setting.rb
trust_level3_requirements.rb FEATURE: add caps to trust level 3 requirements for posts read and topics viewed, configurable in settings 2016-05-25 14:55:49 -04:00
twitter_user_info.rb annotate models 2016-02-23 10:33:53 +11:00
unsubscribe_key.rb FEATURE: configure session time via site setting for all the users (#4343) 2016-07-23 02:57:30 +05:30
upload.rb Add time out when optimizing images. 2017-04-20 15:21:43 +08:00
user_action.rb Convert server side paths to use /u/ 2017-03-30 10:23:24 -04:00
user_api_key.rb annotate models 2016-10-31 15:02:11 +05:30
user_archived_message.rb FEATURE: move_to_inbox and archive_message events 2017-02-28 09:56:41 -05:00
user_auth_token_log.rb Update annotations. 2017-03-22 14:26:53 +08:00
user_auth_token.rb Update annotations. 2017-03-22 14:26:53 +08:00
user_avatar.rb Update annotations. 2016-11-24 10:13:03 +08:00
user_badge.rb annotate models 2016-02-23 10:33:53 +11:00
user_badges.rb FEATURE: you can not drill down and see why you have badges 2016-01-18 17:59:20 +11:00
user_custom_field.rb
user_export.rb PERF: stream CSV exports so they don't fail when they are too big 2016-05-25 22:20:35 +02:00
user_field_option.rb annotate models 2016-02-23 10:33:53 +11:00
user_field.rb remove rails-observers 2016-12-22 16:46:53 +11:00
user_history.rb FEATURE: Native theme support 2017-04-12 10:53:49 -04:00
user_open_id.rb annotate models 2016-02-23 10:33:53 +11:00
user_option.rb PERF: avoid query on every logged on page load 2016-12-05 17:38:02 +11:00
user_profile_view.rb FIX: Don't track user profile view when viewed by system user. 2016-08-23 16:25:31 +08:00
user_profile.rb Revert "FIX: User website allows new TLDs" 2017-04-18 13:18:51 +05:30
user_search_data.rb
user_search.rb FEATURE: allow user search API to restrict to group 2017-02-09 18:45:39 -05:00
user_stat.rb reset bounce score when email is successfully changed 2017-02-20 10:37:01 +01:00
user_summary.rb FIX: most liked queries were leaking info in user summaries 2016-05-30 19:48:46 +02:00
user_visit.rb FEATURE: filter admin reports via user group 2016-02-04 11:23:49 +05:30
user_warning.rb FEATURE: default notification level for group messages 2017-04-20 15:47:35 -04:00
user.rb FIX: send activation email when accepting invite if password is set 2017-04-15 14:59:50 +05:30
username_validator.rb FIX: Don't allow invalid email to be saved. 2016-12-21 17:47:11 +08:00
web_hook_event_type.rb FEATURE: Webhook for user creation and approval 2016-09-19 10:12:55 +08:00
web_hook_event.rb annotate models 2016-10-31 15:02:11 +05:30
web_hook.rb FIX: Add web hook DiscourseEvents in initializer. 2017-04-12 11:55:49 +08:00