Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

Support for ActiveRecord enums #98

Open
mpantel opened this issue May 24, 2018 · 0 comments
Open

Support for ActiveRecord enums #98

mpantel opened this issue May 24, 2018 · 0 comments

Comments

@mpantel
Copy link

mpantel commented May 24, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant