jhollinger / occams-record

The missing high-efficiency query API for ActiveRecord
https://occams.jordanhollinger.com/
MIT License
357 stars 7 forks source link

undefined method `klass' for nil:NilClass (NoMethodError) #10

Closed backward-crazy-mage-puppy-36 closed 1 year ago

backward-crazy-mage-puppy-36 commented 2 years ago

Hi, My environment details are: MacOS Ventura, M1 Rails 7.0.2.4 Ruby 3.1.2p20

On running OccamsRecord.query(DataVendors::NationalStockExchange::BhavCopy.all) I am getting the following error: gems/occams-record-1.3.0/lib/occams-record/query.rb:54:in initialize': undefined methodklass' for nil:NilClass (NoMethodError) @model = scope.klass ^^^^^^

jhollinger commented 2 years ago

That suggests that scope (i.e. DataVendors::NationalStockExchange::BhavCopy.all) is nil. Is there anything odd about that class? Maybe all is overridden?

jhollinger commented 1 year ago

Closing due to inactivity