Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible improvements #35

Open
max-si-m opened this issue Jun 3, 2024 · 0 comments
Open

Possible improvements #35

max-si-m opened this issue Jun 3, 2024 · 0 comments

Comments

@max-si-m
Copy link

max-si-m commented Jun 3, 2024

Hello, I've been recently integrated with your gem, and that is a wonderful piece of art. Helped me a lot, thank you. You did a great job.

I found some places that might be improved or changed according to my understanding:

  • Some models missed the dependent and inverse_of for associations.

  • No generator for models (needed for sharding and fixing associations).

  • No way to attach API routes without a dashboard, when the dashboard isn't required or forbidden.

  • Shouldn't the line 27 be moved to the 32? Is there a reason to generate stale pkpass?

    pass_output_path = Passkit::Generator.new(pass).generate_and_sign
    response.headers["last-modified"] = pass.last_update.httpdate
    if request.headers["If-Modified-Since"].nil? ||
    (pass.last_update.to_i > Time.zone.parse(request.headers["If-Modified-Since"]).to_i)
    send_file(pass_output_path, type: "application/vnd.apple.pkpass", disposition: "attachment")

  • I was curious what is the reason for having multiple passes per one generator? I mean when we have the same class for pass and generator. I've patched that to use find_or_create_by! but I'm wondering, maybe I'm missing something? Wouldn't it create a lot of redundant records?

    def create_pass(pass_class, generator = nil)
    pass = Passkit::Pass.create!(klass: pass_class, generator: generator)
    Passkit::Generator.new(pass).generate_and_sign

Maybe those findings would be helpful. If they are helpful somehow, I can help with some of them if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant