title: Rails: Selecting tasks by month using Date::MONTHNAMES returns incorrect data
body: <p>Here are the associations:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :tasks, through: :user_tasks
    has_many :user_tasks
    has_many :completed_tasks, through: :user_tasks, conditions: { user_tasks: { complete: true } }, source: :task
    has_many :incomplete_tasks, through: :user_tasks, conditions: { user_tasks: { complete: false } }, source: :task
  end
  
  class Task &lt; ActiveRecord::Base
    has_many :resources
    has_many :users, through: :user_tasks
    has_many :users
  end
  
  class Resource &lt; ActiveRecord::Base
    belongs_to :task
  end
  </code></pre>
  
  <p>I have a method called <code>task_notification</code> that takes a parameter of "past" or "future" and the method selects incomplete tasks based off the current month and the task deadline month.</p>
  
  <pre><code>  def task_notification(notification_type = "past")
      return if incomplete_tasks.empty?
  
      operator = notification_type.eql?("past") ? "&lt;" : "&gt;"
  
      current_month = Time.now.month
      incomplete_tasks.by_classification(classification).select { |task| task.due_date.send(operator, current_month) }
    end
  </code></pre>
  
  <p>Here is the Task <code>due_date</code> method:</p>
  
  <pre><code>  def due_date
      month = self.deadline.split(" ") - ["Mid"]
      Date::MONTHNAMES.index(month.first)
    end
  </code></pre>
  
  <p>Here is how a Task above looks like:</p>
  
  <pre><code>&lt;Task id: 12, item: "Meet with guidance counselors and plan to take cour...", deadline: "August First", created_at: "2013-09-24 01:15:25", updated_at: "2013-09-24 01:15:25", classification: "Sophomore"&gt; 
  </code></pre>
  
  <p>The problem is that since the <code>current_month</code> index is 1 (January) and the deadline is set to be in August (index of 8) the script thinks that this task is in the future and needs to be completed. These items should be set to show up in an academic calendar year not a normal calendar year.</p>
  
  <p>Anyway to fix this?</p>