case operator_for(field)
when "=", ">=", "<=", "><"
if values_for(field).detect do |v|
- v.present? &&
- (!/\A\d{4}-\d{2}-\d{2}(T\d{2}((:)?\d{2}){0,2}(Z|\d{2}:?\d{2})?)?\z/.match?(v) ||
- parse_date(v).nil?)
+ v.present? &&
+ (!/\A\d{4}-\d{2}-\d{2}(T\d{2}((:)?\d{2}){0,2}(Z|\d{2}:?\d{2})?)?\z/.match?(v) ||
+ parse_date(v).nil?)
end
add_filter_error(field, :invalid)
end
# preserve the column_names order
cols = (has_default_columns? ? default_columns_names : column_names).collect do |name|
- available_columns.find {|col| col.name == name}
+ available_columns.find {|col| col.name == name}
end.compact
available_columns.select(&:frozen?) | cols
end