Async Ruby on Rails
thoughtbot.com
thoughtbot.com
class Team < ApplicationRecord
has_many :players, dependent: :destroy_async
end
Specifically the following part: dependent: :destroy_asyncSo a method like this would be defined as something like:
def has_many(model_name, dependent:)
puts model_name.to_s
puts dependent.to_s
end
Which you could then call as: has_many(:players, dependent: :destroy_async)
or has_many :players, dependent: :destroy_async
Since you don't need to put parenthesis around method arguments in ruby.