Module: DataActive

Included in:
ActiveRecord::Base
Defined in:
lib/data_active.rb,
lib/data_active/entity.rb,
lib/data_active/parser.rb,
lib/data_active/version.rb,
lib/data_active/attribute.rb,
lib/data_active/sax_document.rb

Defined Under Namespace

Modules: ClassMethods Classes: Attribute, Entity, Parser, SaxDocument

Constant Summary collapse

VALID_FROM_XML_OPTIONS =
[:sync, :create, :update, :destroy, :fail_on_invalid]
VERSION =
'0.0.7'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
# File 'lib/data_active.rb', line 8

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#ensure_unique(name) ⇒ Object



12
13
14
15
16
# File 'lib/data_active.rb', line 12

def ensure_unique(name)
  begin
    self[name] = yield
  end while self.class.exists?(name => self[name])
end