mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-17 19:12:37 -05:00
Fix access specifiers with private_class_methods instead of removing directly
This commit is contained in:
parent
fa830c8d69
commit
9524b514c6
10 changed files with 17 additions and 6 deletions
|
@ -203,4 +203,5 @@ class AdminDashboardData
|
||||||
'dash-data:access_password_removal'
|
'dash-data:access_password_removal'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :access_password_removal_key
|
||||||
end
|
end
|
||||||
|
|
|
@ -81,6 +81,7 @@ SQL
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :apply_default_to_topic
|
||||||
end
|
end
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
class EmailLog < ActiveRecord::Base
|
class EmailLog < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
validates_presence_of :email_type
|
|
||||||
validates_presence_of :to_address
|
|
||||||
|
|
||||||
belongs_to :post
|
belongs_to :post
|
||||||
belongs_to :topic
|
belongs_to :topic
|
||||||
|
|
||||||
|
validates :email_type, :to_address, presence: true
|
||||||
|
|
||||||
scope :sent, -> { where(skipped: false) }
|
scope :sent, -> { where(skipped: false) }
|
||||||
scope :skipped, -> { where(skipped: true) }
|
scope :skipped, -> { where(skipped: true) }
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
class EmailToken < ActiveRecord::Base
|
class EmailToken < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
validates_presence_of :token
|
validates :token, :user_id, :email, presence: true
|
||||||
validates_presence_of :user_id
|
|
||||||
validates_presence_of :email
|
|
||||||
|
|
||||||
before_validation(on: :create) do
|
before_validation(on: :create) do
|
||||||
self.token = EmailToken.generate_token
|
self.token = EmailToken.generate_token
|
||||||
|
|
|
@ -90,4 +90,5 @@ class ErrorLog
|
||||||
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 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :sanitize_backtrace
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,6 +85,8 @@ class GlobalSetting
|
||||||
provider.read
|
provider.read
|
||||||
provider
|
provider
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :parse
|
||||||
end
|
end
|
||||||
|
|
||||||
class EnvProvider < BaseProvider
|
class EnvProvider < BaseProvider
|
||||||
|
|
|
@ -19,4 +19,6 @@ class LocaleSiteSetting < EnumSiteSetting
|
||||||
@supported_locales ||= Dir.glob( File.join(Rails.root, 'config', 'locales', 'client.*.yml') ).map {|x| x.split('.')[-2]}.sort
|
@supported_locales ||= Dir.glob( File.join(Rails.root, 'config', 'locales', 'client.*.yml') ).map {|x| x.split('.')[-2]}.sort
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :supported_locales
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,4 +21,6 @@ class S3RegionSiteSetting < EnumSiteSetting
|
||||||
'ap-northeast-1',
|
'ap-northeast-1',
|
||||||
'sa-east-1']
|
'sa-east-1']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :valid_values
|
||||||
end
|
end
|
||||||
|
|
|
@ -154,6 +154,9 @@ class TopTopic < ActiveRecord::Base
|
||||||
from: start_of(period))
|
from: start_of(period))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :sort_orders, :update_counts_and_compute_scores_for, :remove_invisible_topics,
|
||||||
|
:add_new_visible_topics, :update_posts_count_for, :update_views_count_for, :update_likes_count_for,
|
||||||
|
:compute_top_score_for, :start_of, :update_top_topics
|
||||||
end
|
end
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
|
|
|
@ -13,4 +13,6 @@ class TrustLevelSetting < EnumSiteSetting
|
||||||
def self.valid_values
|
def self.valid_values
|
||||||
TrustLevel.valid_range.to_a
|
TrustLevel.valid_range.to_a
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_class_method :valid_values
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue