From db1d52f21a895af1486437113af697f9d50c1265 Mon Sep 17 00:00:00 2001 From: andrew nimmo Date: Thu, 19 Dec 2024 21:41:36 -0800 Subject: [PATCH] descriptions coercion params --- app/classes/query/initializers/descriptions.rb | 8 ++++++++ app/classes/query/location_with_descriptions.rb | 7 ++----- app/classes/query/name_with_descriptions.rb | 7 ++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/classes/query/initializers/descriptions.rb b/app/classes/query/initializers/descriptions.rb index e11eb78400..6d8ca1b192 100644 --- a/app/classes/query/initializers/descriptions.rb +++ b/app/classes/query/initializers/descriptions.rb @@ -17,6 +17,14 @@ def descriptions_parameter_declarations } end + def descriptions_coercion_parameter_declarations + { + old_title?: :string, + old_by?: :string, + by_author?: User + } + end + def initialize_description_parameters(type = :name) initialize_with_default_desc_parameter(type) initialize_join_desc_parameter(type) diff --git a/app/classes/query/location_with_descriptions.rb b/app/classes/query/location_with_descriptions.rb index 1220f1dec6..4301a6d425 100644 --- a/app/classes/query/location_with_descriptions.rb +++ b/app/classes/query/location_with_descriptions.rb @@ -3,11 +3,8 @@ class Query::LocationWithDescriptions < Query::LocationBase def parameter_declarations super.merge( - ids?: [LocationDescription], - old_title?: :string, - old_by?: :string, - by_author?: User - ) + ids?: [LocationDescription] + ).merge(descriptions_coercion_parameter_declarations) end def initialize_flavor diff --git a/app/classes/query/name_with_descriptions.rb b/app/classes/query/name_with_descriptions.rb index 571f2a9221..e0fd971e47 100644 --- a/app/classes/query/name_with_descriptions.rb +++ b/app/classes/query/name_with_descriptions.rb @@ -3,11 +3,8 @@ class Query::NameWithDescriptions < Query::NameBase def parameter_declarations super.merge( - ids?: [NameDescription], - old_title?: :string, - old_by?: :string, - by_author?: User - ) + ids?: [NameDescription] + ).merge(descriptions_coercion_parameter_declarations) end def initialize_flavor