class ModuleApp include Mongoid::Document field :title, type: String field :key, type: String def get_registration OrbitApp::Module::Registration.find_by_key(key) end def self.find_by_key(key) self.find_by(:key => key) end end