ruby-hyperloop / hyperloop-devise-tutorial

The project has moved to Hyperstack!! - Tutorial demonstrating Devise (authentication) integrated into Hyperloop
https://hyperstack.org/
1 stars 0 forks source link

User.current (called class method missing) #1

Closed sfcgeorge closed 7 years ago

sfcgeorge commented 7 years ago

In our app I've added the current class method but is doesn't work on the client. In fact any class method I add appears to be missing. Oddly though class methods I add to ApplicationRecord do work and are even inherited into user. Any ideas?

Restarting the server and clearing the cache has no effect.

Error: !! User.current() (called class method missing)

Examples:

class ApplicationRecord
  def self.foo
    "foo"
  end
end

class User < ApplicationRecord
  def self.bar
    "bar"
  end
end

ApplicationRecord.foo # works
User.foo # works
User.bar # error
barriehadfield commented 7 years ago

Hi Simon

Is the source in the tutorial working for you or if it only in your app?

Btw - consider reaching us in the gittet chat, there is always someone there to help.

Barrie

On 18 Sep 2017 18:54, "Simon George" notifications@github.com wrote:

In our app I've added the current class method but is doesn't work on the client. In fact any class method I add appears to be missing. Oddly though class methods I add to ApplicationRecord do work and are even inherited into user. Any ideas?

Restarting the server and clearing the cache has no effect.

Error: !! User.current() (called class method missing)

Examples:

class ApplicationRecord self.foo "foo" endend class User < ApplicationRecord def self.bar "bar" endend ApplicationRecord.foo # worksUser.foo # worksUser.bar # error

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ruby-hyperloop/hyperloop-devise-tutorial/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/ADwfm47l2CpVAy5mDdBPWsxgIwGR_Mxdks5sjqBOgaJpZM4PbNll .

sfcgeorge commented 7 years ago

Thank you, I will check out the Gitter.

I think this was the wrong part of Hyperloop to open the issue on. I got it working and found a bit more what was going on so opened a more specific issue on hyper-mesh