Skip to content

Commit

Permalink
misc: Fix existing rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rsempe committed Nov 22, 2024
1 parent e855f39 commit 681d847
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions app/graphql/types/base_argument.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ module Types
class BaseArgument < GraphQL::Schema::Argument
attr_reader :permissions

def initialize(*args, permission: nil, permissions: nil, **kwargs, &block)
def initialize(*, permission: nil, permissions: nil, **, &)
@permissions = if permission
[permission].compact
elsif permissions
Array.wrap(permissions).compact
end

super(*args, **kwargs, &block)
super(*, **, &)
end
end
end
4 changes: 2 additions & 2 deletions app/graphql/types/base_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class BaseField < GraphQL::Schema::Field

attr_reader :permissions

def initialize(*args, permission: nil, permissions: nil, **kwargs, &block)
def initialize(*, permission: nil, permissions: nil, **kwargs, &)
if permission
@permissions = [permission.to_s]
elsif permissions
Expand All @@ -15,7 +15,7 @@ def initialize(*args, permission: nil, permissions: nil, **kwargs, &block)

kwargs[:null] = true if @permissions

super(*args, **kwargs, &block)
super(*, **kwargs, &)

extension(Extensions::FieldAuthorizationExtension) if @permissions
end
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/concerns/sentry_cron_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def serialize
end

def deserialize(job_data)
super(job_data)
super
self.class.sentry = job_data['sentry']
end
end
Expand All @@ -35,7 +35,7 @@ def set(options)
self.sentry = options[:sentry]
end

super(options)
super
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module BillableMetrics
module Aggregations
class LatestService < BillableMetrics::Aggregations::BaseService
def initialize(...)
super(...)
super

event_store.numeric_property = true
event_store.aggregation_property = billable_metric.field_name
Expand Down
2 changes: 1 addition & 1 deletion app/services/billable_metrics/aggregations/max_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module BillableMetrics
module Aggregations
class MaxService < BillableMetrics::Aggregations::BaseService
def initialize(...)
super(...)
super

event_store.numeric_property = true
event_store.aggregation_property = billable_metric.field_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module BillableMetrics
module Aggregations
class UniqueCountService < BillableMetrics::Aggregations::BaseService
def initialize(...)
super(...)
super

event_store.aggregation_property = billable_metric.field_name
event_store.use_from_boundary = !billable_metric.recurring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module BillableMetrics
module Aggregations
class WeightedSumService < BillableMetrics::Aggregations::BaseService
def initialize(...)
super(...)
super

event_store.numeric_property = true
event_store.aggregation_property = billable_metric.field_name
Expand Down
34 changes: 17 additions & 17 deletions lib/tasks/tests/seed_plans.rake
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ end

def find_or_create_metrics(organization)
metrics_params = [
{ name: 'metered_count', agg_type: :count_agg, recurring: false},
{ name: 'metered_count_uniq', agg_type: :unique_count_agg, recurring: false },
{ name: 'metered_latest', agg_type: :latest_agg, recurring: false },
{ name: 'metered_max', agg_type: :max_agg, recurring: false },
{ name: 'metered_sum', agg_type: :sum_agg, recurring: false },
{ name: 'metered_weighted_sum', agg_type: :weighted_sum_agg, recurring: false },
{name: 'recurring_sum', agg_type: :sum_agg, recurring: true },
{name: 'recurring_weighted_sum', agg_type: :weighted_sum_agg, recurring: true }
{name: 'metered_count', agg_type: :count_agg, recurring: false},
{name: 'metered_count_uniq', agg_type: :unique_count_agg, recurring: false},
{name: 'metered_latest', agg_type: :latest_agg, recurring: false},
{name: 'metered_max', agg_type: :max_agg, recurring: false},
{name: 'metered_sum', agg_type: :sum_agg, recurring: false},
{name: 'metered_weighted_sum', agg_type: :weighted_sum_agg, recurring: false},
{name: 'recurring_sum', agg_type: :sum_agg, recurring: true},
{name: 'recurring_weighted_sum', agg_type: :weighted_sum_agg, recurring: true}
]
metered_metrics = metrics_params.map do |params|
metrics_params.map do |params|
organization.billable_metrics.find_or_create_by!(name: params[:name],
code: params[:name],
recurring: params[:recurring],
aggregation_type: params[:agg_type],
field_name: 'test',
weighted_interval: "seconds")
code: params[:name],
recurring: params[:recurring],
aggregation_type: params[:agg_type],
field_name: 'test',
weighted_interval: "seconds")
end
end

Expand Down Expand Up @@ -65,10 +65,10 @@ def build_plan_args(organization, all_metrics, i)
charges_params << charge_params
end

args = {
{
organization_id: organization.id,
name: "Plan parent #{i+1}",
code: "plan_parent_#{i+1}-#{SecureRandom.hex(5)}",
name: "Plan parent #{i + 1}",
code: "plan_parent_#{i + 1}-#{SecureRandom.hex(5)}",
pay_in_advance: [true, false].sample,
amount_cents: Faker::Number.number(digits: 4),
amount_currency: 'USD',
Expand Down

0 comments on commit 681d847

Please sign in to comment.