owen2345/camaleon-cms

Exception after update version 2.6.3 to 2.7.2 -> NoMethodError in CamaleonCms::Admin#dashboard

Closed this issue · 5 comments

I updated the version of gem from 2.6.3 to 2.7.2 and after update I get exception.
I have a model Author and inside I have include CamaleonCms::UserMethods. Also in config/system.json I changed user_model to Author too. But with version 2.6.3 all worked well.
Ruby version 3.2.2, rails version 7.0.4.3.
Easy way to reproduce this - clone sample app, and run bundle update camaleon_cms, it should update camaleon_cms to latest 2.7.2.

Any ideas how to fix it? Thanks.

image

Hello, @Hunk13 !

Is your Author model inheriting from ActiveRecord::Base? If yes, try to change it to inherit from ApplicationRecord.

class Author < ApplicationRecord
  include CamaleonCms::UserMethods
 
  devise :database_authenticatable, :registerable, :confirmable,
         :recoverable, :rememberable, :trackable, :validatable
end

No, Author model inheriting from ApplicationRecord.

Ah, sorry, I forgot that we have moved these methods not to the ApplicationRecord, but to CamaleonRecord.

So, can you, please, try class Author < CamaleonRecord?!

Yes, it's works!
I suppose It will be great to describe this for next developers.
Thanks.

@Hunk13 Sorry for the trouble. It looks like some changes meant to be an internal refactoring were at odds with the documented custom auth procedure.