Created
January 31, 2014 01:26
-
-
Save medhiwidjaja/8724964 to your computer and use it in GitHub Desktop.
AnalysisMethods::Magiq::RankComparable module. Used be Magiq module. The OrdinalComparison object is embedded in the MongoDB document of the object that uses the Magiq module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2012 Medhi Widjaja | |
module AnalysisMethods | |
module Magiq | |
module RankComparable | |
class OrdinalComparison | |
include Mongoid::Document | |
field :id1, type: Moped::BSON::ObjectId | |
field :title, type: String | |
field :pos, type: Integer | |
field :rank, type: Integer | |
field :score, type: Float | |
embedded_in :ordinal_comparable | |
validates_uniqueness_of :id1 | |
validates_presence_of :rank, :pos, :title, :id1 | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment