You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example, if I try to create like below, it will give error
ArgumentError (You tried to define an enum named "payment_sub_status" on the model "OrderPayments::Payment", but this will generate a instance method "pending?", which is already defined by another enum.)
enum payment_status: { pending: 1, success: 2, failed: 3, cancelled: 4 } do
event :succeed do
after do
self.update_sub_status 'success'
end
transition %i[success pending failed] => :success
end
end
enum payment_status2: { pending: 1, success: 2, failed: 3, cancelled: 4 } do
event :succeed do
after do
self.update_sub_status 'success'
end
transition %i[success pending failed] => :success
end
end
The text was updated successfully, but these errors were encountered:
Example, if I try to create like below, it will give error
ArgumentError (You tried to define an enum named "payment_sub_status" on the model "OrderPayments::Payment", but this will generate a instance method "pending?", which is already defined by another enum.)
enum payment_status: { pending: 1, success: 2, failed: 3, cancelled: 4 } do
event :succeed do
after do
self.update_sub_status 'success'
end
transition %i[success pending failed] => :success
end
end
enum payment_status2: { pending: 1, success: 2, failed: 3, cancelled: 4 } do
event :succeed do
after do
self.update_sub_status 'success'
end
transition %i[success pending failed] => :success
end
end
The text was updated successfully, but these errors were encountered: