I know you can run rake tasks and system commands in various ways through Rails, but I’m worried about potential side-effects that I might not understand. So I figured I’d ask you guys if you’ve had any experience with this. Here’s more about my use-case:
I have a singleton model, App, with a column color.
I have a variables.scss.erb file with
$theme: "<%= App.first.color %>"; which is included in various other scss files.
When I precompile my assets it will take the current value for my App’s color, but if it’s updated in the application it won’t take effect until the next precompile. To me it’d make sense to have a background job triggered when the App’s color column is updated. But this is where I get lost, because I’d want this job to trigger a precompile, but is there anything else it would have to do/should do to work? Is this a bad idea?