ruby-hyperloop / hyper-mesh

The project has moved to Hyperstack!! - Synchronization of active record models across multiple clients using Pusher, ActionCable, or Polling
https://hyperstack.org/
MIT License
22 stars 12 forks source link

Support for ActiveRecord enums #98

Open mpantel opened 6 years ago

mpantel commented 6 years ago

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.