Sha256: 80a43c1993af13fdcb17676b5d70eb36ec93c1bf69de19da69c16a819e681fe2
Contents?: true
Size: 498 Bytes
Versions: 19
Compression:
Stored size: 498 Bytes
Contents
class Connection include Mongoid::Document embedded_in :base field :order_id, type: Integer, default: 0 field :parent_id, type: BSON::ObjectId field :file, type: String field :section, type: String #validations validates_numericality_of :order_id, greater_than_or_equal_to: 0 validate :parent_id_should_exist def parent_id_should_exist if parent_id != nil and !Base.exists?(conditions: {id: parent_id}) errors.add :parent_id, "id doesn't exist" end end end
Version data entries
19 entries across 19 versions & 1 rubygems