diff --git a/lib/mini_profiler.rb b/lib/mini_profiler.rb index 3eb012bc..18d44e33 100644 --- a/lib/mini_profiler.rb +++ b/lib/mini_profiler.rb @@ -96,8 +96,15 @@ def advanced_tools_message def binds_to_params(binds) return if binds.nil? || config.max_sql_param_length == 0 - # map ActiveRecord::Relation::QueryAttribute to [name, value] - params = binds.map { |c| c.kind_of?(Array) ? [c.first, c.last] : [c.name, c.value] } + params = binds.map do |c| + if c.kind_of?(Array) + [c.first, c.last] + elsif c.respond_to?(:name) # ActiveRecord::Relation::QueryAttribute + [c.name, c.value] + else # Time, String, Integer + ["param", c] + end + end if (skip = config.skip_sql_param_names) params.map { |(n, v)| n =~ skip ? [n, nil] : [n, v] } else