Module: MotionRecord::Persistence

Included in:
Base
Defined in:
lib/motion_record/persistence.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

TIMESTAMP_COLUMNS =
[:created_at, :updated_at]

Instance Method Summary collapse

Instance Method Details

#destroyObject



10
11
12
# File 'lib/motion_record/persistence.rb', line 10

def destroy
  delete!
end

#mark_persisted!Object



18
19
20
# File 'lib/motion_record/persistence.rb', line 18

def mark_persisted!
  @persisted = true
end

#mark_unpersisted!Object



22
23
24
# File 'lib/motion_record/persistence.rb', line 22

def mark_unpersisted!
  @persisted = false
end

#persisted?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/motion_record/persistence.rb', line 14

def persisted?
  !!@persisted
end

#saveObject



6
7
8
# File 'lib/motion_record/persistence.rb', line 6

def save
  persist!
end