rails/action_push_native

Consider not requiring ApplicationRecord

Closed this issue · 3 comments

I ran into an issue during a staging deploy where it appears this gem assumes the presence of an ApplicationRecord class. This might be acceptable for Rails, so feel free to close, but could be worth documenting or considering if there's a way around it.

Interesting. Just to confirm: you’re running it outside of Rails, and to make it work all you needed was this snippet?

# adding ApplicationRecord, mentioned in issue #45
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
end

Correct?

I'm running a Rails app, just that it was created 10 years ago, before ApplicationRecord was generated by default, and I never got around to adding it. I can't say I've tested this gem in a non-Rails app, then, but I thought it was a bit strange for the gem to assume the presence of ApplicationRecord in my app, so figured it worth mentioning. Not a big deal, obviously, but you could consider trying to test using the gem outside of Rails with a custom Device model to see if it's not too much work to support? Otherwise feel free to close as non-planned or w/e, it's not an active issue for me, since I just added ApplicationRecord into my app finally 😂

Ahh, I see! I assumed the presence of ApplicationRecord since it was added in Rails 5 😅. I appreciate the report, but I'll keep it as it is for now.