lib/rails_powergrid/smart_date/smart_date.rb
# Return the sql to filter for this period.
Return the sql to filter for this period.
Return the sql to filter for this period .
def generate_sql field, operator, value
      if value!="NULL" && value!="NOT NULL"
        real_date = Chronic.parse(value, guess: false)
        if real_date.nil?
          ActiveRecord::Base::sanitize(false) 
        else
          operation field, operator, ActiveRecord::Base::sanitize(real_date.begin),
            ActiveRecord::Base::sanitize(real_date.end)
        end
      else
        "#{field} #{operator} #{value}"
      end
    end
def generate_sql field , operator , value if value != "NULL" && value != "NOT NULL" real_date = Chronic . parse ( value , guess : false ) if real_date . nil? ActiveRecord :: Base :: sanitize ( false ) else operation field , operator , ActiveRecord :: Base :: sanitize ( real_date . begin ) , ActiveRecord :: Base :: sanitize ( real_date . end ) end else "#{field} #{operator} #{value}" end end
Return the sql to filter for this period.
Return the sql to filter for this period .
#`False` filter?
field
<not_specific>
operator
<not_specific>
value
<not_specific>