Class: Cartify::OrderStatus

Inherits:
ApplicationRecord show all
Defined in:
app/models/cartify/order_status.rb

Instance Method Summary collapse

Instance Method Details

#valid_step?(target) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'app/models/cartify/order_status.rb', line 10

def valid_step?(target)
  if Cartify::OrderStatus.find(target).name == 'delivered'
    name == 'in_delivery'
  else
    Cartify::OrderStatus.prohibited_to_change.ids.exclude? target.to_i
  end
end