Sha256: 1b2322f568f7027da98566e95257e653e9124267feaa3ff82799e15e188a75a5

Contents?: true

Size: 395 Bytes

Versions: 4

Compression:

Stored size: 395 Bytes

Contents

module CurationConcern
  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

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
worthwhile-0.1.2 worthwhile-models/app/models/concerns/curation_concern/versioned_content.rb
worthwhile-models-0.1.2 app/models/concerns/curation_concern/versioned_content.rb
worthwhile-0.1.1 worthwhile-models/app/models/concerns/curation_concern/versioned_content.rb
worthwhile-models-0.1.1 app/models/concerns/curation_concern/versioned_content.rb