Sha256: f693b131d745e23d498cadc524a7c238e2b41dff01efd1a2939a5e3caa5c87fd

Contents?: true

Size: 1.8 KB

Versions: 13

Compression:

Stored size: 1.8 KB

Contents

#--
# Copyright (c) 2015+ Damjan Rems
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

########################################################################
# Mongoid::Document model for dc_idents emdedded documents.
# 
# dc_idents are similar to mongoid hash structure and can be used for saveing 
# key/value object. Fact is that I have overlooked the existance of MongoDB Hash field type
# and this structure will be used until drg_forms_field which will use Hash field type is created.
#########################################################################
class DcIdent
  include Mongoid::Document
  include Mongoid::Timestamps

  field   :key,       type: String
  field   :value,     type: String

  embedded_in :idents, polymorphic: true 
  
  validates :key, presence: true
  validates :value, presence: true
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
drg_cms-0.5.8 app/models/dc_ident.rb
drg_cms-0.5.7 app/models/dc_ident.rb
drg_cms-0.5.6 app/models/dc_ident.rb
drg_cms-0.5.5 app/models/dc_ident.rb
drg_cms-0.5.3 app/models/dc_ident.rb
drg_cms-0.5.2 app/models/dc_ident.rb
drg_cms-0.5.1 app/models/dc_ident.rb
drg_cms-0.5.0 app/models/dc_ident.rb
drg_cms-0.4.61 app/models/dc_ident.rb
drg_cms-0.4.58 app/models/dc_ident.rb
drg_cms-0.4.57 app/models/dc_ident.rb
drg_cms-0.4.54 app/models/dc_ident.rb
drg_cms-0.4.53 app/models/dc_ident.rb