Sha256: 5e4735e9b3570bc4913e06b72e254d55263fefacf18fdeddce24b53882dcb87f

Contents?: true

Size: 741 Bytes

Versions: 26

Compression:

Stored size: 741 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    class Column
      def klass_with_time_of_day
        return TimeOfDay if :time === type
        klass_without_time_of_day
      end
      alias_method_chain :klass, :time_of_day
      
      def self.string_to_dummy_time(string)
        return string if string.is_a? TimeOfDay
        return nil if string.empty?
        TimeOfDay.parse(string)
      end
    end
    module Quoting
      def quote_with_time_of_day(value, column = nil)
        return "'#{quoted_time(value)}'" if TimeOfDay === value
        quote_without_time_of_day(value, column)
      end
      alias_method_chain :quote, :time_of_day
      
      def quoted_time(value)
        value.to_s
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
activerecord-time-0.2.0 lib/activerecord-time/extension.rb
activerecord-time-0.1.0 lib/activerecord-time/extension.rb
activerecord-time-0.0.1 lib/activerecord-time/extension.rb
backlog-0.37.2 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.37.1 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.36.2 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.24.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.25.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.26.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.28.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.29.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.30.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.31.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.32.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.31.1 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.33.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.34.1 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.33.1 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.34.2 vendor/plugins/rails_time/lib/activerecord_time_extension.rb
backlog-0.35.0 vendor/plugins/rails_time/lib/activerecord_time_extension.rb