Module: SimpleSlug::ModelAddition::InstanceHistoryMethods

Defined in:
lib/simple_slug/model_addition.rb

Instance Method Summary collapse

Instance Method Details

#simple_slug_cleanup_historyObject



80
81
82
# File 'lib/simple_slug/model_addition.rb', line 80

def simple_slug_cleanup_history
  ::SimpleSlug::HistorySlug.where(sluggable_type: self.class.name, sluggable_id: id).delete_all
end

#simple_slug_resetObject



76
77
78
# File 'lib/simple_slug/model_addition.rb', line 76

def simple_slug_reset
  errors.blank? || simple_slug_adapter.reset(self)
end

#simple_slug_save_historyObject



84
85
86
# File 'lib/simple_slug/model_addition.rb', line 84

def simple_slug_save_history
  simple_slug_adapter.save_history(self)
end