Skip to content

Conversation

@jenshenny
Copy link
Contributor

At Shopify, we have custom ApplicationRecord models that we would want Run to inherit from.

This PR extracts the behaviour of the Run model to a concern. This enables custom run models to include the behaviour from the Run model, while being able to inherit from different ApplicationRecord from the gem standard.

class CustomRun < CustomApplicationRecord
  include MaintenanceTasks::RunConcern
end

@etiennebarrie
Copy link
Member

We already have an undocumented way to inject a Run model in Runner:

def run(name:, csv_file: nil, arguments: {}, run_model: Run, metadata: nil)

We don't have a way to share the code with another class with a different superclass, that's true. Let's just make this a private API though.

@jenshenny jenshenny force-pushed the extract-run-concern branch 2 times, most recently from eaa6d4d to a1ca9c7 Compare February 10, 2026 14:45
@jenshenny jenshenny merged commit 6527410 into main Feb 10, 2026
43 checks passed
@jenshenny jenshenny deleted the extract-run-concern branch February 10, 2026 15:36
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