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
|
end
|
||||||
|
|
||||||
def stable_self
|
def stable_self
|
||||||
OpenStruct.new(to_key: [stable_id],
|
KeyableModel.new(
|
||||||
model_name: OpenStruct.new(param_key: model_name.param_key))
|
to_key: [stable_id],
|
||||||
|
model_name: KeyableModel.new(param_key: model_name.param_key)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def refresh_after_update?
|
def refresh_after_update?
|
||||||
|
|
Loading…
Add table
Reference in a new issue