discourse/app/models
Nick Borromeo b51bebb200 Extract queries to keep logic in the Categories Model
This creates two methods in the Category model. This moves the model
logic to the model and just calls the Category class methods in
ListController.

This also adds tests for the two methods created in the Category
model. The motivation for this refactor is the code climate score of the
this class and readability of the code.

 Please enter the commit message for your changes. Lines starting
2014-02-08 14:10:48 -08:00
..
admin_dashboard_data.rb Rename favorite to starred everywhere 2014-01-10 14:54:19 -05:00
api_key.rb annotate models 2013-12-05 17:40:35 +11:00
cas_user_info.rb annotate models 2013-06-17 02:49:34 +02:00
category_featured_topic.rb Don't include category definitions on Categories page 2014-02-07 17:01:31 -05:00
category_featured_user.rb PERF: optimise featuring of topics and users 2014-01-30 10:32:20 +11:00
category_group.rb work in progress, add fidelity to category group permissions (full, create posts, readonly) 2013-07-16 15:46:11 +10:00
category_list.rb Admins don't see uncategorized on /categories if it has no topics and allow_uncategorized_topics is false 2014-01-15 14:11:36 -05:00
category_search_data.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
category_user.rb Update annotations 2014-02-07 11:07:52 +11:00
category.rb Extract queries to keep logic in the Categories Model 2014-02-08 14:10:48 -08:00
digest_email_site_setting.rb Enum site settings can have translatable names in dropdown. Add setting for how often users get digest emails by default: default_digest_email_frequency. 2013-08-23 17:36:25 -04:00
discourse_version_check.rb FIX: issue 1538. After upgrading and before a new version check request has been made, dashboard might still say that an update is available. 2013-11-04 12:51:09 -05:00
draft_sequence.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
draft.rb Avoid superfluous transaction when saving drafts 2013-10-02 12:17:27 +10:00
email_log.rb Refactor SessionController#create, reduce complexity. 2013-11-15 22:09:03 +05:30
email_token.rb Refactor update_all statements in order to prevent deprecation warnings in Rails 4 2013-07-02 18:36:47 +02:00
error_log.rb filter params correctly from error log 2013-10-13 08:07:45 +11:00
facebook_user_info.rb Enabled strong_parameters across all models/controllers. 2013-06-06 00:30:59 -07:00
github_user_info.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
global_setting.rb Source DB config more cleanly, fixes issues with socket in prd 2014-01-15 12:08:35 +11:00
group_user.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
group.rb FEATURE: First stab at groups page with member list 2014-02-07 10:44:51 -05:00
incoming_link.rb BUGFIX: invalid referer would cause 500 errors 2013-12-30 14:05:44 +11:00
incoming_links_report.rb The Rails JSON encoder API requires as_json to take an optional arg 2013-11-29 21:43:44 -08:00
invite_redeemer.rb Trust Level 3: invited users start at default_invitee_trust_level + 1, unless default_invitee_trust_level is 2 or higher 2014-01-17 11:12:00 -05:00
invite.rb Update annotations 2014-02-07 11:07:52 +11:00
leader_requirements.rb Track how many posts a user reads each day in user_visits 2014-01-27 11:20:19 -05:00
locale_site_setting.rb Enum site settings can have translatable names in dropdown. Add setting for how often users get digest emails by default: default_digest_email_frequency. 2013-08-23 17:36:25 -04:00
min_trust_to_create_topic_setting.rb Add min_trust_to_create_topic setting to require a certain trust level before users can start new topics 2013-09-03 19:12:22 -04:00
notification.rb Refactor update_all statements in order to prevent deprecation warnings in Rails 4 2013-07-02 18:36:47 +02:00
oauth2_user_info.rb annotate models 2013-08-28 10:52:06 +10:00
optimized_image.rb pull hotlinked images 2013-11-05 19:07:29 +01:00
plugin_store_row.rb annotate models 2013-08-28 10:52:06 +10:00
plugin_store.rb PluginStore for plugin specific bits of storage 2013-08-26 12:59:17 +10:00
post_action_type.rb security issue, anon and logged in users could see the fact that a user sent another user a pm (but could not see the pm itself or title) 2013-10-03 16:48:03 -07:00
post_action.rb pull hotlinked images 2013-11-05 19:07:29 +01:00
post_alert_observer.rb BUGFIX: emails sent from "2 replies" as opposed to correct user 2014-02-04 12:56:28 +11:00
post_analyzer.rb Work in progress: Swap out onebox code for onebox gem 2014-01-29 14:14:07 -05:00
post_detail.rb annotate models 2013-12-05 17:40:35 +11:00
post_mover.rb Support for choosing a destination category when splitting topics. 2013-10-29 15:30:06 -04:00
post_reply.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
post_revision.rb Update annotations 2014-02-07 11:07:52 +11:00
post_search_data.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
post_timing.rb large refactor, ship a few columns from the user table into user_stats 2013-10-07 15:04:59 +11:00
post_upload.rb annotate models 2013-06-17 02:49:34 +02:00
post.rb Update annotations 2014-02-07 11:07:52 +11:00
report.rb Rename favorite to starred everywhere 2014-01-10 14:54:19 -05:00
s3_region_site_setting.rb Enum site settings can have translatable names in dropdown. Add setting for how often users get digest emails by default: default_digest_email_frequency. 2013-08-23 17:36:25 -04:00
screened_email.rb annotate models 2013-12-05 17:40:35 +11:00
screened_ip_address.rb annotate models 2013-12-05 17:40:35 +11:00
screened_url.rb annotate models 2013-12-05 17:40:35 +11:00
search_observer.rb Fix locale dependend stemmer for FTS 2013-07-23 03:07:59 +04:00
site_content_type.rb FEATURE: allow for custom HTML inside the <head> tags 2014-01-02 16:22:04 +01:00
site_content.rb Add site setting tos_accept_required. If enabled, users must check a box saying that they've read and accept the terms of service. 2014-02-07 16:04:13 -05:00
site_customization.rb Revert "Re-apply with fixes: Stop using user agent to detect mobile devices. Use a media query and yepnope to load the appropriate css and customizations." 2013-12-18 14:47:22 -05:00
site_setting.rb use_ssl is just confusing, it means use_https , fix name of setting 2014-01-09 10:51:38 +11:00
site.rb BUGFIX: JS error when login_required is enabled 2014-01-20 14:41:11 +01:00
top_lists.rb BUGFIX: show the draft on top page 2014-02-06 11:39:43 +01:00
top_menu_item.rb BUGFIX: proper handling of top_menu_items 2014-02-03 16:08:00 +01:00
top_topic.rb Update annotations 2014-02-07 11:07:52 +11:00
topic_allowed_group.rb Enabled strong_parameters across all models/controllers. 2013-06-06 00:30:59 -07:00
topic_allowed_user.rb Enabled strong_parameters across all models/controllers. 2013-06-06 00:30:59 -07:00
topic_embed.rb Update annotations 2014-02-07 11:07:52 +11:00
topic_featured_users.rb Support for tracking the count of unique participants in a topic 2013-11-14 14:32:41 -05:00
topic_invite.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
topic_link_click.rb FIX: Incorrect string match 2014-01-14 15:38:12 -05:00
topic_link.rb Rename TopicSummary -> TopicMap 2013-11-18 12:08:21 -05:00
topic_list.rb PERF: optimise featuring of topics and users 2014-01-30 10:32:20 +11:00
topic_notifier.rb FEATURE: mute/watch/track buttons for private conversations 2014-01-22 17:46:52 +11:00
topic_poster.rb topic_poster.rb: Fix formatting of the attributes return value 2013-03-23 19:09:01 +05:30
topic_posters_summary.rb Fix TopicPostersSummary when a suggested topic includes a user who has been deleted 2013-05-27 14:12:15 -04:00
topic_revision.rb Update annotations 2014-02-07 11:07:52 +11:00
topic_status_update.rb FIX: When re-opening a topic that auto-closed, make sure it won't auto-close again 2013-12-19 11:25:05 -05:00
topic_tracking_state.rb fix topic counts not updating automatically in various spots (top menu / categories page / drop down) 2013-11-25 17:37:51 +11:00
topic_user.rb Update annotations 2014-02-07 11:07:52 +11:00
topic.rb Update annotations 2014-02-07 11:07:52 +11:00
twitter_user_info.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
upload.rb annotate models 2013-12-05 17:40:35 +11:00
user_action_observer.rb FEATURE: collapse replies to topics 2014-02-03 13:59:14 +11:00
user_action.rb SECURITY: reduce moderator rights 2014-02-07 14:11:52 +11:00
user_email_observer.rb revert non queuing of emails 2013-08-27 11:52:28 +10:00
user_history.rb Don't notify about dominating private messages. 2014-02-07 05:49:45 +05:30
user_open_id.rb Enabled strong_parameters across all models/controllers. 2013-06-06 00:30:59 -07:00
user_search_data.rb moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
user_search.rb SiteSetting to hide regular names from users 2013-10-30 15:45:34 -04:00
user_stat.rb BUGFIX: UserStat spec was over ambitious with its mocking 2014-01-06 16:50:55 +11:00
user_visit.rb Update annotations 2014-02-07 11:07:52 +11:00
user.rb Link to groups from user profile 2014-02-07 10:44:51 -05:00
username_validator.rb [0] is shorter than [0,1] :) 2013-12-17 16:30:25 +01:00
view.rb annotate models 2013-12-05 17:40:35 +11:00