Sha256: 83245ebbe0e3f926103a796e5390ab82d08c10571187d783f1b9b37367e574a0

Contents?: true

Size: 438 Bytes

Versions: 5

Compression:

Stored size: 438 Bytes

Contents

module Worthwhile
  class GenericFile
    module VersionedContent
      def versions
        return [] unless persisted?
        @versions ||= content.versions.collect {|version| Worthwhile::ContentVersion.new(content, version)}
      end

      def latest_version
        versions.first || Worthwhile::ContentVersion::Null.new(content)
      end

      def current_version_id
        latest_version.version_id
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
worthwhile-0.1.0 worthwhile-models/app/models/concerns/worthwhile/generic_file/versioned_content.rb
worthwhile-models-0.1.0 app/models/concerns/worthwhile/generic_file/versioned_content.rb
worthwhile-0.0.3 app/models/concerns/worthwhile/generic_file/versioned_content.rb
worthwhile-0.0.2 app/models/concerns/worthwhile/generic_file/versioned_content.rb
worthwhile-0.0.1 app/models/concerns/worthwhile/generic_file/versioned_content.rb