Sha256: 312f277f2186c2a5d3b6a9a23f3b742693743049f10fb5e0c204018c965eb749

Contents?: true

Size: 508 Bytes

Versions: 12

Compression:

Stored size: 508 Bytes

Contents

class OperationDecorator < ApplicationDecorator
  # TODO: cleanup after manual migration of user data to operations

  def past_tense
    object.type.humanize + (object.type[-1] == 'e' ? 'd' : 'ed')
  end

  def creator_gravatar
    return nil if object.user.nil? && object.user_email.nil?
    email = object.user_email || object.user.email
    h.gravatar_url(email, 32)
  end

  def creator_name
    return nil if object.user.nil? && object.user_name.nil?
    object.user_name || object.user.name
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
aptible-rails-0.7.3 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.7.2 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.7.1 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.7.0 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.13 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.12 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.11 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.10 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.9 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.8 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.7 lib/aptible/rails/decorators/operation_decorator.rb
aptible-rails-0.6.6 lib/aptible/rails/decorators/operation_decorator.rb