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

Class method missing quirk #38

Closed sfcgeorge closed 7 years ago

sfcgeorge commented 7 years ago

I can reproduce this behaviour in our work app but I can't reproduce in a minimal app which isn't very helpful.

The snippet causing issues:

class Todo < ApplicationRecord
  phony_normalize :title, default_country_code: "GB" # actually missing

  def self.foo # error
    "foo"
  end
end

And then Todo.foo in a component.

The phony_normalize method isn't available on the front end (fine) but the error I actually get is RuntimeError: Todo.foo (called class method missing). Which is unhelpful in tracking down what's actually wrong.

But as I said I can't reproduce, sorryi; when I try in a minimal app I do get the error pointing to phony_normalize. I don't know how Opal would be able to partially compile the class in some cases even though it can't find bits. Or could hyper-mesh be doing something odd?

Todo: test again when Hyperloop works with Opal 0.11 as that might fix it

sfcgeorge commented 7 years ago

I'm pretty sure this is caused by then STI class issue #39 so closing this one.