I’m new to Shrine and created a new Rails app for trying it out.
While playing along with the “Getting Started” doc I ran into problems.
Instead of images for a photo model I’m trying to add avatars to the user model.
After adding the include to the User model however, things stop working:
class User < ApplicationRecord include AvatarUploader::Attachment(:avatar) end 2.7.1 :001 > User.first Traceback (most recent call last): 3: from (irb):1 2: from app/models/user.rb:1:in `<main>' 1: from app/models/user.rb:2:in `<class:User>' NameError (uninitialized constant User (call 'User.connection' to establish a connection)::AvatarUploader)
AvatarUploader exists (like this:)
class AvatarUploader < Shrine end
Am I overlooking something obvious? Any help would be appreciated.
I’m trying this on Rails 6.