title: Ruby on Rails syntax error for module definition
body: <p>This is my one of schema files built with Ruby on Rails.
  When I try to run <code>rails db:migrate</code> the rails app,  I'm getting the syntax error such as </p>
  
  <pre><code>SyntaxError: /home/../[file_name].rb:14: module definition in method body
        module SkipCallbacks
                            ^
  bin/rails:4:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:migrate
  </code></pre>
  
  <p>How do I have to handle this issue? Rails version: 5.2.3, ruby version: 2.5.1</p>
  
  <pre><code>class SetInformation &lt; ActiveRecord::Migration[5.2]
  
    def change
      Information.all.find_each do |info|
      place = info.places.first
  
        module SkipCallbacks
          def run_callbacks(kind, *args, &amp;block)
            yield(*args) if block_given?
          end
        end
  
          if business.physical_address.present?
             ... ...
              dup_address.extend(SkipCallbacks)
             ... ...
          end
  
          ... ... ... ...
       end
    end
  end
  </code></pre>