Skip to content

Conversation

@adrianna-chang-shopify
Copy link
Contributor

@adrianna-chang-shopify adrianna-chang-shopify commented Mar 29, 2021

v1.2.0 is broken for all Rails versions < 6.1.0 due to has_one_attached: unknown keyword: service (ArgumentError), introduced in this PR.

Couldn't think of a better way to patch this and preserve functionality for Rails < 6.1.0 while allowing service configuration for Rails 6.1+ apps than checking the kwargs on the method and either passing in a service or not 😅 Let me know if you can think of a better way!

Opting instead to check for the presence of the MaintenanceTasks.active_storage_service config instead to check if we should specify the service kwarg, rather than doing parameter introspection.

I think we may also want to expand our test suite to test against a dummy app that use Rails 6.0, and then Rails 6.1 to make sure we catch things like this moving forward.

🎩

  • Change the dummy to use Rails 6.0
  • Without these changes, has_one_attached: unknown keyword: service (ArgumentError) should be raised
  • With these changes, ActiveStorage should be fine
  • Moving back to Rails 6.1, these changes should be fine

@adrianna-chang-shopify adrianna-chang-shopify merged commit b761430 into main Mar 29, 2021
@adrianna-chang-shopify adrianna-chang-shopify deleted the fix-activestorage-incompatibility branch March 29, 2021 19:18
lawrencewong pushed a commit to lawrencewong/maintenance_tasks that referenced this pull request Apr 29, 2023
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

Successfully merging this pull request may close these issues.

2 participants