Created
August 17, 2011 16:05
-
-
Save cousine/1151875 to your computer and use it in GitHub Desktop.
Models structure
This file contains hidden or 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
class MongoidAlpha | |
include Mongoid::Document | |
#include Mongoid::Mebla | |
field :name | |
field :value, :type => Integer | |
field :cost, :type => Float | |
field :hidden | |
#self.whiny_indexing = true | |
belongs_to :mongoid_epsilon | |
#search_in :name, :cost, :value | |
end | |
class MongoidPi | |
include Mongoid::Document | |
#include Mongoid::Mebla | |
field :name | |
#self.whiny_indexing = true | |
has_one :mongoid_epsilon, :autosave => true | |
#search_in :name, :does_smth | |
def does_smth | |
"returns smth" | |
end | |
end | |
class MongoidEpsilon | |
include Mongoid::Document | |
#include Mongoid::Mebla | |
field :name | |
#self.whiny_indexing = true | |
belongs_to :mongoid_pi | |
has_many :mongoid_alphas, :autosave => true | |
#search_in :name, :search_relations => {:mongoid_pi => :name, :mongoid_alphas => [:name, :value]} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment