class ApplicationFormUser include Mongoid::Document include Mongoid::Timestamps field :user_name field :password belongs_to :application_form_main # belongs_to :user # before_save do # if self.new_record? # self.user = User.find() # end # end end