def method_missing(name, *args, &block) # rubocop:disable Style/MethodMissing
      association_options = args.first

      if association_options.nil?
        __declare_attribute__(name, block)
      elsif __valid_association_options?(association_options)
        association(name, association_options)
      else
        raise NoMethodError.new(<<~MSG)
          undefined method '#{name}' in '#{@definition.name}' factory
          Did you mean? '#{name} { #{association_options.inspect} }'
        MSG
      end
    end
def method_missing(name, *args, &block) # rubocop:disable Style/MethodMissing
      association_options = args.first

      if association_options.nil?
        __declare_attribute__(name, block)
      elsif __valid_association_options?(association_options)
        association(name, association_options)
      else
        raise NoMethodError.new(<<~MSG)
          undefined method '#{name}' in '#{@definition.name}' factory
          Did you mean? '#{name} { #{association_options.inspect} }'
        MSG
      end
    end
Calls add_attribute using the missing method name as the name of the
 attribute, so that:

   factory :user do
     name { 'Billy Idol' }
   end

 and:

   factory :user do
     add_attribute(:name) { 'Billy Idol' }
   end

 are equivalent.

 If no argument or block is given, factory_bot will first look for an
 association, then for a sequence, and finally for a trait with the same
 name. This means that given an "admin" trait, an "email" sequence, and an
 "account" factory:

   factory :user, traits: [:admin] do
     email { generate(:email) }
     association :account
   end

 and:

   factory :user do
     admin
     email
     account
   end

 are equivalent.