Sha256: 6b7a715f67b2aaa821b4db0b2474bbb8257d5b32feb476f107d6d5d495b08b46

Contents?: true

Size: 640 Bytes

Versions: 5

Compression:

Stored size: 640 Bytes

Contents

require 'active_record'
require 'ardm'
require 'ardm/ar/base'

module Ardm
  module Ar
    class Record < ::ActiveRecord::Base
      include Ardm::Ar::Base

      self.abstract_class = true

      def self.property(property_name, property_type, options={})
        prop = super
        begin
          attr_accessible prop.name
          attr_accessible prop.field
        rescue => e
          puts "WARNING: `attr_accessible` not found. Include 'protected_attributes' gem in rails >= 4 (if you need it).\n#{e}" unless $attr_accessible_warning
          $attr_accessible_warning = true
        end
        prop
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ardm-0.4.0.ar427 lib/ardm/ar/record.rb
ardm-0.4.0 lib/ardm/ar/record.rb
ardm-0.3.2 lib/ardm/ar/record.rb
ardm-0.3.1 lib/ardm/ar/record.rb
ardm-0.3.0 lib/ardm/ar/record.rb