Module: OhNoes::Destroy

Extended by:
ActiveSupport::Concern
Included in:
Action, Discount, EventsPassType, ImportMessage, Item, Order, PassType, Person
Defined in:
app/concerns/oh_noes.rb

Instance Method Summary collapse

Instance Method Details

#destroy(options = {}) ⇒ Object



12
13
14
15
16
17
# File 'app/concerns/oh_noes.rb', line 12

def destroy(options = {})
  return false unless destroyable? || !!options[:with_prejudice]
  run_callbacks :destroy do
    update_column(:deleted_at, Time.now)
  end
end

#destroyable?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/concerns/oh_noes.rb', line 19

def destroyable?
  true
end