coorasse / passkit

Wallet Pass generation for Ruby On Rails
MIT License
90 stars 27 forks source link

Question: Pass model name specification in factory #11

Closed AlanMcCann closed 1 year ago

AlanMcCann commented 1 year ago

Hi:

I had to fork the repo and specify the module name in lib/passkit/factory.rb to prevent an uninitialized constant Pass error

I'm not sure if that is a bug or something missing from my configuration.

module Passkit
  class Factory
    class << self
      def create_pass(pass_class, generator = nil)
        pass = Passkit::Pass.create!(klass: pass_class, generator: generator)
        Passkit::Generator.new(pass).generate_and_sign
      end
    end
  end
end
Screenshot 2023-04-23 at 7 13 24 PM
jonathandean commented 1 year ago

@AlanMcCann this is an old issue so I'm not sure if you still need an answer but in the screenshot you have Pass.create! and in the code snipped you have Passkit::Pass.create. Were you able to resolve this issue?

coorasse commented 1 year ago

I am not sure how this could happen, but adding the Passkit namespace won't hurt. I just added it and pushed to main.