lhs icon indicating copy to clipboard operation
lhs copied to clipboard

LHS::Record classes are not automatically reloaded

Open 10xSebastian opened this issue 8 years ago • 2 comments

When rails is running and LHS::Record classes are changed, the change does not get automatically reloaded.

10xSebastian avatar Mar 08 '16 09:03 10xSebastian

You may want to add those loaded files into this array and then reloading magic will happens

https://github.com/rails/rails/blob/master/activesupport/lib/active_support/dependencies.rb#L83

I tested it with adding a new method to LHS::Record inheriting model and it was available on the next request.

kot-begemot avatar May 17 '16 13:05 kot-begemot

I'm having similar problems with this:

class Backend::Place < Backend::AuthorizedRecord
  endpoint ':datastore/v2/places/:id', auth: { bearer: -> { bearer_token } }
end

class Backend::AuthorizedRecord < LHS::Record
  def self.bearer_token
    RequestStore.store[:bearer_token]
  end
end

nerdinand avatar May 25 '16 13:05 nerdinand