You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurred while Rails/HasManyOrHasOneDependent cop was inspecting /Users/viktor/Developer/Ruby/CivicLift/app/models/concerns/has_many_records.rb:23:8.
undefined method `pairs' for s(:lvar, :opts):RuboCop::AST::Node
options = options.first.children.first.pairs if options.first.kwsplat_type?
^^^^^^
/Users/viktor/.rvm/gems/ruby-3.1.1/gems/rubocop-rails-2.14.2/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb:119:in `valid_options?'
/Users/viktor/.rvm/gems/ruby-3.1.1/gems/rubocop-rails-2.14.2/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb:80:in `on_send'
File that produces this error:
# frozen_string_literal: truemoduleHasManyRecordsextendActiveSupport::Concernclass_methodsdo# creates has_many relationship for each of the record types# example:# has_many_records -> { pending }, prefix: :pending, class_name: true# which generates:# has_many :pending_events, -> { pending }, class_name: 'Event'defhas_many_records(scope=nil,records_types: RecordsType::ALL_TYPES,prefix: nil,suffix: nil, **options)# rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Naming/PredicateNameopts=options.dupclass_name=opts.delete(:class_name)source_type=opts.delete(:source_type)source=opts.delete(:source)ifopts[:source] == truerecords_types.each_keydo |records_type|
record_model_name=records_type.classifyopts[:class_name]=record_model_nameifclass_nameopts[:source_type]=record_model_nameifsource_typeopts[:source]=records_typeifsource == truehas_many[prefix,records_type,suffix].compact.join('_').to_sym,scope, **optsendendendend
Std output:
File that produces this error:
RuboCop version
Let me know if there's any other useful info I can provide. Thanks!
The text was updated successfully, but these errors were encountered: