2021-04-29 21:17:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ReloadHelpers
|
|
|
|
def reload_models(*models)
|
2021-06-08 01:23:25 +05:30
|
|
|
models.compact.map(&:reload)
|
2021-04-29 21:17:54 +05:30
|
|
|
end
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
def subject_and_reload(...)
|
2021-04-29 21:17:54 +05:30
|
|
|
subject
|
2023-04-23 21:23:45 +05:30
|
|
|
reload_models(...)
|
2021-04-29 21:17:54 +05:30
|
|
|
end
|
|
|
|
end
|