local-ch / lhs

⚛️ REST services accelerator: Rails gem providing an easy, active-record-like interface for http (hypermedia) json services
GNU General Public License v3.0
137 stars 3 forks source link

LHS::Record classes are not automatically reloaded #94

Open 10xSebastian opened 8 years ago

10xSebastian commented 8 years ago

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

kot-begemot commented 8 years ago

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.

nerdinand commented 8 years ago

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