Permalink
Browse files

clean up code

  • Loading branch information...
Istvan DEMETER
Istvan DEMETER committed Jul 27, 2012
1 parent d6e5ff7 commit 9eb9afc35c66c15c0057fb09e54ff198beee5924
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/active_admin/mongoid/adapter.rb
  2. +5 −5 lib/active_admin/mongoid/filter_form_builder.rb
@@ -15,7 +15,7 @@ def respond_to?(method_id)
end
def method_missing(method_id, *args, &block)
- is_available?(method_id) ? @search_params[method_id] : @query.send(method_id, *args, &block)
+ is_available?(method_id) ? @search_params[method_id.to_s] : @query.send(method_id, *args, &block)
end
private
@@ -3,17 +3,17 @@ def default_input_type(method, options = {})
if column = column_for(method)
case column.type.name.downcase.to_sym
when :date, :datetime
- return :date_range
+ :date_range
when :string, :text
- return :string
+ :string
when :integer
return :select if reflection_for(method.to_s.gsub('_id','').to_sym)
- return :numeric
+ :numeric
when :float, :decimal
- return :numeric
+ :numeric
end
else # dirty but allows to create filters for hashes
- return :string
+ :string
end
end

0 comments on commit 9eb9afc

Please sign in to comment.