Class: DataMapper::Property::ParanoidBoolean

Inherits:
Boolean
  • Object
show all
Defined in:
lib/dm-types/paranoid_boolean.rb

Instance Method Summary collapse

Instance Method Details

#bindObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dm-types/paranoid_boolean.rb', line 10

def bind
  property_name = name.inspect

  model.class_eval <<-RUBY, __FILE__, __LINE__ + 1
    include DataMapper::Types::Paranoid::Base

    set_paranoid_property(#{property_name}) { true }

    default_scope(#{repository_name.inspect}).update(#{property_name} => false)
  RUBY
end