hyper-mesh icon indicating copy to clipboard operation
hyper-mesh copied to clipboard

Support for ActiveRecord enums

Open mpantel opened this issue 7 years ago • 0 comments

I have an activerecord column of the enum type.

I get an "Exception raised while saving - FloatDomainError: NaN" error on the js console on save just before the model.save promise resolves.

Data persists in database and the promise never resolves(succeeding or failing...)

class WithEnum < ApplicationRecord
  enum  some_attribute: {first: 0, second: 1, third: 2}
end

and in the component i have:

an_object = WithEnum.new
an_object.some_attribute = 1
an_object.save. then { alert 'saved' }.fail { alert 'failed' }

an_object.save -> persist the object and raises in js console

"then" or "fail" part never executes.

mpantel avatar May 24 '18 19:05 mpantel