title: Not getting required result from if else in helper method
body: <p>I have used the helper for displaying background color for holidays and leaves and I'm calling the helper method from view like this - </p>
  
  <pre><code>%th{:class =&gt; weekend_class_top(date)}= date.strftime("%d")
  </code></pre>
  
  <p>helper method which has been called - </p>
  
  <pre><code>def weekend_class_top(date)
      if (date == date.end_of_month)
        'weekend_color5'
      elsif (date.to_s(:weekend) == 'Sun')  
        'weekend_color3'
      elsif @holidays.any?
        @holidays.map.each do |holiday|
          if (date == holiday)
            'timesheet_holiday_color'
          end
        end
      elsif @user_leaves.any?
        @user_leaves.flatten.map.each do |leave|
          if (date == leave)
            'timesheet_leave_color'
          end
        end
      end
    end
  </code></pre>
  
  <p>the code that I have written, I'm getting background color only for holidays not leaves even though both holidays and leaves are present.</p>
  
  <p>This is edited helper method - </p>
  
  <pre><code>def weekend_class_top(date)
      if (date == date.end_of_month)
        'weekend_color5'
      elsif (date.to_s(:weekend) == 'Sun')  
        'weekend_color3'
      elsif @holidays.any?
        @holidays.map.each do |holiday|
          if @user_leaves.any?
            @user_leaves.flatten.map.each do |leave|
              if (date == leave)
                'timesheet_leave_color'
              end
            end
          elsif (date == holiday)
            'timesheet_holiday_color'
          end
        end
      end
    end
  </code></pre>
  
  <p>Through the above written methd I'm only getting the background color for leaves but <em>not for holidays</em>.</p>