Sha256: 70e996c4caa14c9c20c8c0d229028e51aa7675d107134df0a3cd653dfbd29aea
Contents?: true
Size: 737 Bytes
Versions: 7
Compression:
Stored size: 737 Bytes
Contents
# encoding: utf-8 # # Copyright (C) 2011-2012 AdMaster, Inc. module <%= module_name %> class <%= camelize name %> include Apimaster::Mapper include Mongoid::Document field :title, type: String field :content, type: String attr_options :title, accessor: [:get, :list], required: [:post], optional: [:patch] attr_options :content, accessor: [:get], required: [:post], optional: [:patch] validates :title, length: { minimum: 2, maximum: 30 } # Embedded 1-1 # embeds_one :label, class_name: "<%= module_name %>::Label" class << self def get id find id or raise MissingError.new(<%= name %>, :id) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems