Skip to content

Instantly share code, notes, and snippets.

View durran's full-sized avatar

Durran Jordan durran

View GitHub Profile
class BasalPlan
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::DeepVersioning
field :name, :type => String
belongs_to :user, :inverse_of => :basal_plan
has_many :basal_entries
accepts_nested_attributes_for :basal_entries, :reject_if => lambda { |attrs| attrs[:_delete].present? }
require 'rubygems'
puts ENV["GEM_HOME"]
require 'mongoid'
require 'mongoid/version'
puts "Using Mongoid: #{Mongoid::VERSION}"
Mongoid.master = Mongo::Connection.new.db("mongoid_playground")
class Orphan