From b8231e04d5de9992b6303c80dd7796e90ba8baa0 Mon Sep 17 00:00:00 2001 From: Craig McNamara Date: Thu, 18 May 2023 00:16:37 -0700 Subject: [PATCH] Add namespaced example --- 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 +```