Sha256: 1d08a294c798d6ae3ad8ee08c122fafafe16b2486f207f83bb320e8ea85b8d69

Contents?: true

Size: 530 Bytes

Versions: 1

Compression:

Stored size: 530 Bytes

Contents

module Mongoid
  module Character
    extend ActiveSupport::Concern

    included do
      include Mongoid::Timestamps
      include Mongoid::SerializableId
      include ActionView::Helpers::DateHelper
    end


    def _list_item_title
      first_non_id_attribute = self.attributes.keys.select { |k| k != '_id' }.first
      self[first_non_id_attribute].to_s
    end


    def _list_item_subtitle
      "created #{ time_ago_in_words(created_at) } ago" if created_at
    end


    def _list_item_thumbnail
    end
  end
end




Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chr-0.3.5 lib/mongoid/character.rb