Class: DataMapper::Types::ParanoidBoolean

  • Object
    • DataMapper::Types::ParanoidBoolean

Public Visibility

Public Class Method Summary

bind(property)

Public Instance Methods Inherited from Object

validatable?

Public Class Method Details

bind

public bind(property)
[View source]


7
8
9
10
11
12
13
14
15
# File 'dm-core/lib/dm-core/types/paranoid_boolean.rb', line 7

def self.bind(property)
  model = property.model
  repository = property.repository

  model.class_eval "def destroy\nattribute_set(\#{property.name.inspect}, true)\nsave\nend\n"

  model.send(:scope_stack) << DataMapper::Query.new(repository, model, property.name => nil)

end