Sha256: 4ef19cdf7da67140809b20a65573f2030ab3abc9acbabcca989b94141a2df939

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

require 'monitor'

require 'active_support/concern'
require 'active_support/core_ext/object/blank'
require 'active_support/inflector'
require 'active_model'

require 'zermelo/associations/class_methods'

require 'zermelo/records/instance_methods'
require 'zermelo/records/class_methods'
require 'zermelo/records/type_validator'

module Zermelo

  module Record

    extend ActiveSupport::Concern

    include Zermelo::Records::InstMethods

    included do
      include ActiveModel::AttributeMethods
      extend ActiveModel::Callbacks
      extend ActiveModel::Naming
      include ActiveModel::Dirty
      include ActiveModel::Validations
      include ActiveModel::Validations::Callbacks

      extend Zermelo::Records::Attributes

      # include ActiveModel::MassAssignmentSecurity

      @lock = Monitor.new

      extend Zermelo::Records::ClassMethods
      extend Zermelo::Associations::ClassMethods

      attr_accessor :attributes

      define_model_callbacks :create, :update, :destroy

      attribute_method_suffix  "="  # attr_writers
      # attribute_method_suffix  ""   # attr_readers # DEPRECATED

      validates_with Zermelo::Records::TypeValidator

      define_attributes :id => :string
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zermelo-1.3.0 lib/zermelo/record.rb
zermelo-1.2.1 lib/zermelo/record.rb
zermelo-1.2.0 lib/zermelo/record.rb