Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #2877: postgresql-time-defaults-broken.patch

File postgresql-time-defaults-broken.patch, 0.8 kB (added by stephen_purcell@yahoo.com, 4 years ago)
  • old/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb

    old new  
    412412          return value if value =~ /^[0-9]+(\.[0-9]*)?/ 
    413413 
    414414          # Date / Time magic values 
    415           return Time.now.to_s if value =~ /^now\(\)|^\('now'::text\)::(date|timestamp)/i 
     415          return nil if value =~ /^now\(\)|^\('now'::text\)::(date|timestamp)/i 
    416416 
    417417          # Fixed dates / times 
    418418          return $1 if value =~ /^'(.+)'::(date|timestamp)/