activerecord-hackery / squeel

Active Record, improved. Live again :)
http://erniemiller.org/2013/11/17/anyone-interested-in-activerecord-hackery/
MIT License
2.4k stars 214 forks source link

squeel "TO_TIMESTAMP" #357

Open mooreniemi opened 9 years ago

mooreniemi commented 9 years ago

using where without squeel, i am seeing a sql output of "TO_DATE", but with squeel i am seeing it go to "TO_TIMESTAMP"

i am using oracle, jruby, oracle_enhanced_adapter, and rails 3. i can't see any tests in the squeel spec folder that specifiy squeel's behavior around time, date, and/or datetime objects. in other words, how does squeel decide to use "TO_TIMESTAMP" based on the ruby object?

the only other hint i have is that oracle has different expectations of field type based on input format, ie:

:nls_date_format => 'YYYY-MM-DD HH24:MI:SS', vs :nls_timestamp_format => 'YYYY-MM-DD HH24:MI:SS:FF6',

so my guess is that squeel is automatically sending with FF6, but i will need the ability to send through ruby time or date objects in to either cast. thoughts?