Remove unused private methods (#39902)
This commit is contained in:
1 parent
c4eb8a366c
commit
acd8461169
6 files changed
-63
No files matched your search
@@ -23,12 +23,6 @@ class AnnualReport::TimeSeries < AnnualReport::Source
|
||||
@followers_this_year ||= @account.passive_relationships.where(created_in_year, @year).count
|
||||
end
|
||||
|
||||
def date_part_month
|
||||
Arel.sql(<<~SQL.squish)
|
||||
DATE_PART('month', created_at)::int
|
||||
SQL
|
||||
end
|
||||
|
||||
def created_in_year
|
||||
Arel.sql(<<~SQL.squish)
|
||||
DATE_PART('year', created_at) = ?
|
||||
|
||||
@@ -27,20 +27,6 @@ class AnnualReport::TopStatuses < AnnualReport::Source
|
||||
.first
|
||||
end
|
||||
|
||||
def most_favourited_status
|
||||
base_scope
|
||||
.excluding(most_reblogged_status)
|
||||
.order(favourites_count: :desc)
|
||||
.first
|
||||
end
|
||||
|
||||
def most_replied_status
|
||||
base_scope
|
||||
.excluding(most_reblogged_status, most_favourited_status)
|
||||
.order(replies_count: :desc)
|
||||
.first
|
||||
end
|
||||
|
||||
def base_scope
|
||||
report_statuses
|
||||
.distributable_visibility
|
||||
|
||||
@@ -224,10 +224,6 @@ class SignedRequest
|
||||
def body_digest
|
||||
@body_digest ||= Digest::SHA256.base64digest(request_body)
|
||||
end
|
||||
|
||||
def missing_required_signature_parameters?
|
||||
@signature.parameters['keyid'].blank?
|
||||
end
|
||||
end
|
||||
|
||||
attr_reader :signature
|
||||
|
||||
@@ -215,18 +215,6 @@ module Paperclip
|
||||
ColorDiff::Color::RGB.new(*hsl_to_rgb(hue, saturation, light))
|
||||
end
|
||||
|
||||
def palette_from_im_histogram(result, quantity)
|
||||
frequencies = result.scan(/([0-9]+):/).flatten.map(&:to_f)
|
||||
hex_values = result.scan(/\#([0-9A-Fa-f]{6,8})/).flatten
|
||||
total_frequencies = frequencies.sum.to_f
|
||||
|
||||
frequencies.map.with_index { |f, i| [f / total_frequencies, hex_values[i]] }
|
||||
.sort_by { |r| -r[0] }
|
||||
.reject { |r| r[1].size == 8 && r[1].end_with?('00') }
|
||||
.map { |r| ColorDiff::Color::RGB.new(*r[1][0..5].scan(/../).map { |c| c.to_i(16) }) }
|
||||
.slice(0, quantity)
|
||||
end
|
||||
|
||||
def rgb_to_hex(rgb)
|
||||
format('#%02x%02x%02x', rgb.r, rgb.g, rgb.b) # rubocop:disable Style/FormatStringToken
|
||||
end
|
||||
|
||||
@@ -16,27 +16,4 @@ RSpec.describe 'Profile' do
|
||||
expect(page)
|
||||
.to have_title("alice (@alice@#{local_domain_uri.host})")
|
||||
end
|
||||
|
||||
def submit_form
|
||||
first('button[type=submit]').click
|
||||
end
|
||||
|
||||
def account_fields_labels
|
||||
page.all('.account_fields_name input')
|
||||
end
|
||||
|
||||
def account_fields_values
|
||||
page.all('.account_fields_value input')
|
||||
end
|
||||
|
||||
def change_account_fields
|
||||
change { bob.account.reload.fields }
|
||||
.from([])
|
||||
.to(
|
||||
contain_exactly(
|
||||
be_a(Account::Field),
|
||||
be_a(Account::Field)
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
@@ -38,10 +38,6 @@ RSpec.describe 'Settings preferences appearance page' do
|
||||
form_label('defaults.setting_boost_modal')
|
||||
end
|
||||
|
||||
def theme_selection_field
|
||||
form_label('defaults.setting_theme')
|
||||
end
|
||||
|
||||
def advanced_layout_field
|
||||
form_label('defaults.setting_advanced_layout')
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user