Class: Ardm::Ar::Record

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Base
Defined in:
lib/ardm/ar/record.rb

Class Method Summary collapse

Methods included from Validations

extract_options

Methods included from Repository

#repository

Methods included from Query

order

Methods included from Property

#assign_attributes, #attribute_get, #attribute_set, extended, #fields, #initialize_ardm_property_defaults, #key, #properties, #reset_key

Methods included from Persistence

#destroy, #new?, #save, #save!, #save_self, #saved?, #update, #update!

Methods included from Dirty

#dirty?, #dirty_attributes, #method_missing

Methods included from Finalize

finalize, finalizers, on_finalize

Methods included from Associations

convert_options

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ardm::Ar::Dirty

Class Method Details

.property(property_name, property_type, options = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ardm/ar/record.rb', line 12

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