Sha256: 038ec8af04c750600a50b2b14d255f0e505ca95abb8ee9ac5248f37f0c3b2c54

Contents?: true

Size: 521 Bytes

Versions: 22

Compression:

Stored size: 521 Bytes

Contents

module Ants
  module Versions
    extend ActiveSupport::Concern

    included do

      # returns list of available object versions, requires
      # include Mongoid::History::Trackable to be configured
      def _document_versions
        hash = {}

        history_tracks.only(:created_at, :version).collect do |h|
          hash[h.version] = "Version #{ h.version } — #{ h.created_at }"
        end

        if hash.empty?
          hash = { '' => '--' }
        end

        return hash
      end

    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ants-0.3.14 lib/concerns/ants/versions.rb
ants-0.3.13 lib/concerns/ants/versions.rb
ants-0.3.12 lib/concerns/ants/versions.rb
ants-0.3.11 lib/concerns/ants/versions.rb
ants-0.3.10 lib/concerns/ants/versions.rb
ants-0.3.9 lib/concerns/ants/versions.rb
ants-0.3.5 lib/concerns/ants/versions.rb
ants-0.3.4 lib/concerns/ants/versions.rb
ants-0.3.3 lib/concerns/ants/versions.rb
ants-0.3.2 lib/concerns/ants/versions.rb
ants-0.3.1 lib/concerns/ants/versions.rb
ants-0.3.0 lib/concerns/ants/versions.rb
ants-0.2.8 lib/concerns/ants/versions.rb
ants-0.2.7 lib/concerns/ants/versions.rb
ants-0.2.6 lib/concerns/ants/versions.rb
ants-0.2.5 lib/concerns/ants/versions.rb
ants-0.2.4 lib/concerns/ants/versions.rb
ants-0.2.3 lib/concerns/ants/versions.rb
ants-0.2.2 lib/concerns/ants/versions.rb
ants-0.2.1 lib/concerns/ants/versions.rb