Sha256: 3b3fe8593815c720649a7b947b50da1964159fb0fef39bd48b39f6ce8b6c4e72

Contents?: true

Size: 405 Bytes

Versions: 1

Compression:

Stored size: 405 Bytes

Contents

module Mongoid::Rating
  class Rate
    include Mongoid::Document
    include Mongoid::Timestamps::Short
    
    embedded_in :rateable, polymorphic: true
    belongs_to :rater, polymorphic: true, inverse_of: nil

    # rate can be integer or float so we don't force class here
    field :value

    def rails_admin_default_object_label_method
      "Mongoid::Rating::Rate ##{id.to_s}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid_rating-0.1.5 lib/mongoid_rating/rate.rb