Skip to content

Commit

Permalink
descriptions coercion params
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Dec 20, 2024
1 parent 84ce713 commit db1d52f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 8 additions & 0 deletions app/classes/query/initializers/descriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 2 additions & 5 deletions app/classes/query/location_with_descriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions app/classes/query/name_with_descriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db1d52f

Please sign in to comment.