From e13cf7b503d72e9645ee6ce623e10f3f2fd6ec9d Mon Sep 17 00:00:00 2001 From: Craig McNamara Date: Sun, 30 Jul 2023 12:31:59 -0700 Subject: [PATCH] Add namespaced example (#1422) --- docs/docs/going-further/polymorphic-search.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/going-further/polymorphic-search.md b/docs/docs/going-further/polymorphic-search.md index cadaa705..724b1532 100644 --- a/docs/docs/going-further/polymorphic-search.md +++ b/docs/docs/going-further/polymorphic-search.md @@ -38,3 +38,9 @@ Location.ransack(locatable_of_House_type_number_eq: 100).result ``` note the `_of_House_type_` added to the search key. This allows Ransack to correctly specify the table names in SQL join queries. + +For namespaced models you should use a quoted string containing the standard Ruby module notation + +```ruby +Location.ransack('locatable_of_Residences::House_type_number_eq' => 100).result +```