Sha256: d4d14c81c83d434aa78b954cd88febbfcccd94a870e83587b38c22a9e8538a34
Contents?: true
Size: 348 Bytes
Versions: 7
Compression:
Stored size: 348 Bytes
Contents
# encoding: utf-8 module DataMapper module Aspects module Status def self.statuses %w(draft published archived).freeze end def self.included(base) base.property :status, String, default: ->(r,p) { self.statuses.first } base.validates_within :status, set: self.statuses end end end end
Version data entries
7 entries across 7 versions & 1 rubygems