title: is their any date filter in ruby?
body: <p>1) 
     i have a leave request form in my HRM application, i want that when a user enter the "from_date", the "to_date" should be greater than "from_that"?</p>
  
  <p>2)
     In my app i have a leave model in which user can defined leave type and day's allowed.In my second model leave_request user can request for leave according to leave type.Everything is working well.Now i want to display leave balance available to user on basis of allowed day's in leave_request form?</p>
  
  <p>Migration leave.rb:</p>
  
  <pre><code>  class CreateLeaves &lt; ActiveRecord::Migration
        def self.up
          create_table :leaves do |t|
            t.integer :user_id
            t.integer :company_id
            t.string  :leave_type
            t.integer :allowed_leaves
            t.text :description, :limit =&gt; 500
  
            t.timestamps
          end
        end
  
        def self.down
          drop_table :leaves
        end
      end
  </code></pre>
  
  <p>And leave_request.rb:</p>
  
  <pre><code> class CreateLeaveRequests &lt; ActiveRecord::Migration
        def self.up
          create_table :leave_requests do |t|
            t.integer :employee_id
            t.integer :leave_type
            t.date :from_date
            t.date :to_date
            t.text :reason_for_leave
            t.string :contact_during_leave, :limit =&gt; 10
  
            t.integer :user_id
            t.integer :company_id
  
            t.timestamps
          end
        end
  
        def self.down
          drop_table :leave_requests
        end
      end
  </code></pre>
  
  <p>And can i validate number of leaves available like if user do not have enough leave balance than their should be a message like"You do not have enough leave to request " etc.</p>