title: Ruby: How to call function before it is defined?
body: <p>In my <code>seeds.rb</code> file I would like to have the following structure:</p>
  
  <pre><code># begin of variables initialization
  groups = ...
  # end of variables initialization
  check_data
  save_data_in_database
  
  # functions go here
  def check_data
    ...
  end
  def save_data_in_database
    ...
  end
  </code></pre>
  
  <p>However, I got an error because I call <code>check_data</code> before it is defined. Well, I can put the definition at the top of the file, but then the file will be less readable for my opinion. Is there any other workaround ?</p>