Sha256: 207299508cc1016a066b2d583ba85503e0dc368a2368224332b9b05e6bb6084a
Contents?: true
Size: 457 Bytes
Versions: 9
Compression:
Stored size: 457 Bytes
Contents
module AuditRails module DBExtension def adapter_type connection.adapter_name.downcase.to_sym end def hourly(column) case adapter_type when :mysql, :mysql2 "hour(#{column})" when :sqlite, :sqlite3 "strftime('%H', #{column})" when :postgresql "DATE_PART('hour', #{column})" else raise NotImplementedError, "Unknown adapter type '#{adapter_type}'" end end end end
Version data entries
9 entries across 9 versions & 1 rubygems