Class: DataMapper::Types::ParanoidDateTime
- Object
- DataMapper::Types::ParanoidDateTime
Public Visibility
Public Class Method Summary
| bind(property) |
|---|
Public Instance Methods Inherited from Object
Public Class Method Details
bind
public
bind(property)
[View source]
6 7 8 9 10 11 12 13 14
# File 'dm-core/lib/dm-core/types/paranoid_datetime.rb', line 6 def self.bind(property) model = property.model repository = property.repository model.class_eval "def destroy\nattribute_set(\#{property.name.inspect}, DateTime::now)\nsave\nend\n" model.send(:scope_stack) << DataMapper::Query.new(repository, model, property.name => nil) end