In Postgres, these two queries are different: |-- Casts right hand string values to date since that''s what we''re comparing. -- true SELECT ''2011-11-11''::date BETWEEN ''2011-11-11 11:22:33'' AND ''2011-11-11 22:33:44'' -- Respects right hand types and compares timestamps to date at midnight -- false SELECT ''2011-11-11''::date BETWEEN ''2011-11-11 11:22:33''::timestamp AND ''2011-11-11 22:33:44''::timestamp| When using Arel via ActiveRecord to compare columns against native Ruby values, Time objects just get quoted to database strings. e.g. |Model.where(check_in_date: time1..time2) # or where(arel_table[:check_in_date].eq(time1..time2))| I''m thinking of how this could be handled better for different types. Could we consider adding type casting functions to Arel? Should native Ruby types be cast to native database types by default? Andrew Vit -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.