Sha256: 7f24ce9e273c8a14ac4fd91e3775760da30a1ea8d6a5de218312f60af7af34c7

Contents?: true

Size: 311 Bytes

Versions: 5

Compression:

Stored size: 311 Bytes

Contents

module RailsConnector

  # Adds support for string columns which contain ISO dates
  module DateAttribute
    def self.parse(iso_date_time)
      Time.from_iso(iso_date_time).in_time_zone
    rescue ArgumentError
      raise "The value is not a valid ISO date time: #{iso_date_time.inspect}"
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
infopark_cloud_connector-7.1.0 lib/rails_connector/date_attribute.rb
infopark_cloud_connector-7.0.2 lib/rails_connector/date_attribute.rb
infopark_cloud_connector-7.0.1 lib/rails_connector/date_attribute.rb
infopark_cloud_connector-7.0.0 lib/rails_connector/date_attribute.rb
infopark_cloud_connector-6.9.5 lib/rails_connector/date_attribute.rb