Sha256: 76677e1e830957da4430bab4cebc7e468ba9720dc8d55964705eccd2a9d7d1f4

Contents?: true

Size: 361 Bytes

Versions: 9

Compression:

Stored size: 361 Bytes

Contents

module YariiEditor
  module DocumentHelper
    def status_of_document(document)
      if document.will_be_published?
        if CurrentSite.site.repository.git.diff('HEAD', '--cached').path(document.file_path).stats[:total][:files] == 1
          :queued
        else
          :published
        end
      else
        return :draft
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yarii-editor-0.4.8 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.7 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.6 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.5 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.4 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.3 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.2 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.1 app/helpers/yarii_editor/document_helper.rb
yarii-editor-0.4.0 app/helpers/yarii_editor/document_helper.rb