Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:4015836
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
module ActiveAdmin
class ResourceDSL
def filter(*args)
field = args[0]
klass = @config.resource_class_name.constantize
type = klass.columns.select{|c| c.name == field.to_s}.first.try(:type)
 
if type == :datetime
controller do
before_filter :only => :index do
if !params["q"].blank? && !params["q"]["#{field}_lte"].blank?
params["q"]["#{field}_lte"] += " 23:59:59.999999"
end
end
end
end
 
super
end
end
end

Hi, thanks for the tip. Watch out, though : master (1.0.x.pre) branch now uses params["q"]["#{field}_lteq"] (notice the ending 'q').

Should we create a new file called ResourceDSL for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.