Sha256: ccacaf42a4fccc48c5d601ba1c35cecfca64f2839cc664958496bedf810829b8

Contents?: true

Size: 391 Bytes

Versions: 1

Compression:

Stored size: 391 Bytes

Contents

require "administrate/field/base"
require 'rails'

module Administrate
  module Field
    class Unixtime < Administrate::Field::Base
      def to_s
        return '-' unless data

        pretty
      end

      def pretty
        return unless data
        ::Time.at(data).to_s
      end

      class Engine < ::Rails::Engine; end
    end
  end
end
Unixtime = Administrate::Field::Unixtime

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
administrate-field-unixtime-0.0.1 lib/administrate/field/unixtime.rb