perf(type-de-champ): replace stable_self OpenStruct by Struct model
This commit is contained in:
parent
fa74cdb4c7
commit
e807752a78
2 changed files with 5 additions and 2 deletions
1
app/models/KeyableModel.rb
Normal file
1
app/models/KeyableModel.rb
Normal file
|
@ -0,0 +1 @@
|
|||
KeyableModel = Struct.new(:model_name, :to_key, :param_key, keyword_init: true)
|
|
@ -614,8 +614,10 @@ class TypeDeChamp < ApplicationRecord
|
|||
end
|
||||
|
||||
def stable_self
|
||||
OpenStruct.new(to_key: [stable_id],
|
||||
model_name: OpenStruct.new(param_key: model_name.param_key))
|
||||
KeyableModel.new(
|
||||
to_key: [stable_id],
|
||||
model_name: KeyableModel.new(param_key: model_name.param_key)
|
||||
)
|
||||
end
|
||||
|
||||
def refresh_after_update?
|
||||
|
|
Loading…
Reference in a new issue