Sha256: 3cc53ba4903f392d99cf8db147d946a85e0079edfd385bcd3da53b9739839451

Contents?: true

Size: 616 Bytes

Versions: 25

Compression:

Stored size: 616 Bytes

Contents

module Recruiter
  module PublicableDecoratorHelper
    def created_at_ago
      h.time_ago_in_words(object.created_at)
    end

    def updated_at_ago
      h.time_ago_in_words(object.created_at)
    end

    def updated?
      updated_at_ago != created_at_ago
    end

    def published_at
      h.t("recruiter.messages.published_at", time: created_at_ago)
    end

    def updated_at
      h.t("recruiter.messages.updated_at", time: updated_at_ago)
    end

    def publication
      published_at.tap do |string|
        if updated?
          string << ' | ' << updated_at
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
recruiter-1.1.18 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.17 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.16 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.15 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.14 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.12 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.11 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.10 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.9 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.8 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.7 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.6 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.5 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.4 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.3 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.2 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.1 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.1.0 lib/recruiter/publicable_decorator_helper.rb
recruiter-1.0.0 lib/recruiter/publicable_decorator_helper.rb
recruiter-0.1.5 lib/recruiter/publicable_decorator_helper.rb