mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 11:32:24 -05:00
removed usless access modifiers specified in models
This commit is contained in:
parent
1a2070b4d9
commit
9d11ccc42e
13 changed files with 61 additions and 87 deletions
|
@ -194,12 +194,11 @@ class AdminDashboardData
|
||||||
I18n.t(i18n_key)
|
I18n.t(i18n_key)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.report_access_password_removal
|
def self.report_access_password_removal
|
||||||
$redis.setex access_password_removal_key, 172_800, 'dashboard.access_password_removal'
|
$redis.setex access_password_removal_key, 172_800, 'dashboard.access_password_removal'
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.access_password_removal_key
|
def self.access_password_removal_key
|
||||||
'dash-data:access_password_removal'
|
'dash-data:access_password_removal'
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,7 +35,6 @@ class CategoryFeaturedTopic < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
def self.fake_admin
|
def self.fake_admin
|
||||||
# fake an admin
|
# fake an admin
|
||||||
admin = User.new
|
admin = User.new
|
||||||
|
|
|
@ -60,8 +60,6 @@ class CategoryUser < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.apply_default_to_topic(topic, level, reason)
|
def self.apply_default_to_topic(topic, level, reason)
|
||||||
# Can not afford to slow down creation of topics when a pile of users are watching new topics, reverting to SQL for max perf here
|
# Can not afford to slow down creation of topics when a pile of users are watching new topics, reverting to SQL for max perf here
|
||||||
sql = <<SQL
|
sql = <<SQL
|
||||||
|
|
|
@ -27,8 +27,6 @@ class Draft < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def self.find_draft(user, key)
|
def self.find_draft(user, key)
|
||||||
if user.is_a?(User)
|
if user.is_a?(User)
|
||||||
find_by(user_id: user.id, draft_key: key)
|
find_by(user_id: user.id, draft_key: key)
|
||||||
|
|
|
@ -85,8 +85,6 @@ class ErrorLog
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.sanitize_backtrace(trace)
|
def self.sanitize_backtrace(trace)
|
||||||
re = Regexp.new(/^#{Regexp.escape(Rails.root.to_s)}/)
|
re = Regexp.new(/^#{Regexp.escape(Rails.root.to_s)}/)
|
||||||
trace.map { |line| Pathname.new(line.gsub(re, "[RAILS_ROOT]")).cleanpath.to_s }
|
trace.map { |line| Pathname.new(line.gsub(re, "[RAILS_ROOT]")).cleanpath.to_s }
|
||||||
|
|
|
@ -80,8 +80,6 @@ class GlobalSetting
|
||||||
@data.keys
|
@data.keys
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
|
||||||
def self.parse(file)
|
def self.parse(file)
|
||||||
provider = self.new(file)
|
provider = self.new(file)
|
||||||
provider.read
|
provider.read
|
||||||
|
|
|
@ -12,9 +12,6 @@ class LocaleSiteSetting < EnumSiteSetting
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
@lock = Mutex.new
|
@lock = Mutex.new
|
||||||
|
|
||||||
def self.supported_locales
|
def self.supported_locales
|
||||||
|
|
|
@ -26,10 +26,6 @@ class PluginStore
|
||||||
PluginStoreRow.where(plugin_name: plugin_name, key: key).destroy_all
|
PluginStoreRow.where(plugin_name: plugin_name, key: key).destroy_all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
|
|
||||||
def self.determine_type(value)
|
def self.determine_type(value)
|
||||||
value.is_a?(Hash) || value.is_a?(Array) ? "JSON" : value.class.to_s
|
value.is_a?(Hash) || value.is_a?(Array) ? "JSON" : value.class.to_s
|
||||||
end
|
end
|
||||||
|
|
|
@ -431,8 +431,6 @@ class PostAction < ActiveRecord::Base
|
||||||
PostActionType.types[post_action.post_action_type_id]
|
PostActionType.types[post_action.post_action_type_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def self.target_moderators
|
def self.target_moderators
|
||||||
Group[:moderators].name
|
Group[:moderators].name
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,8 +9,6 @@ class S3RegionSiteSetting < EnumSiteSetting
|
||||||
@values ||= valid_values.sort.map {|x| {name: x, value: x} }
|
@values ||= valid_values.sort.map {|x| {name: x, value: x} }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.valid_values
|
def self.valid_values
|
||||||
[ '',
|
[ '',
|
||||||
'us-east-1',
|
'us-east-1',
|
||||||
|
|
|
@ -28,7 +28,6 @@ class TopTopic < ActiveRecord::Base
|
||||||
TopTopic.refresh_older!
|
TopTopic.refresh_older!
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.periods
|
def self.periods
|
||||||
@@periods ||= [:yearly, :monthly, :weekly, :daily].freeze
|
@@periods ||= [:yearly, :monthly, :weekly, :daily].freeze
|
||||||
|
|
|
@ -10,8 +10,6 @@ class TrustLevelSetting < EnumSiteSetting
|
||||||
@values ||= valid_values.map {|x| {name: x.to_s, value: x} }
|
@values ||= valid_values.map {|x| {name: x.to_s, value: x} }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.valid_values
|
def self.valid_values
|
||||||
TrustLevel.levels.values.sort
|
TrustLevel.levels.values.sort
|
||||||
end
|
end
|
||||||
|
|
|
@ -271,8 +271,6 @@ SQL
|
||||||
self.synchronize_starred
|
self.synchronize_starred
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def self.update_like_count(user_id, action_type, delta)
|
def self.update_like_count(user_id, action_type, delta)
|
||||||
if action_type == LIKE
|
if action_type == LIKE
|
||||||
UserStat.where(user_id: user_id).update_all("likes_given = likes_given + #{delta.to_i}")
|
UserStat.where(user_id: user_id).update_all("likes_given = likes_given + #{delta.to_i}")
|
||||||
|
|
Loading…
Reference in a new issue