And, just to be certain, I see this:

*>> Entity.apply_scopes(scopes).to_sql*
=> "SELECT [entities].* FROM [entities] WHERE (entities.entity_type = 
N'corporation')"

There's no sign of the 'status' attribute I was hoping to filter on. 

Tim


On Thursday, June 11, 2015 at 10:26:48 PM UTC-4, Tim Griffin wrote:
>
> Hi all;
>
> Perhaps I'm missing something, but I was expecting two filter parameters 
> to become part of a query through scopes.merge! But, one seems to be 
> dropped.
>
> From an index page, I have two filter combos that will form a query such 
> as this:
>
> http://localhost:3000/admin/entities?status=active&entity_type=corporation
>
> In my #index controller method, I have
>
>     scopes = {                                                             
>   
>       search: [params[:search], :fileno, :name], 
>       order_by: parse_sort_param(:id, :fileno, :name)
>     }
>     scopes.merge!(status_is: params[:status])
>     scopes.merge!(entity_type_is: params[:entity_type])
>
> But, the resulting query that gets fed to PostgreSQL is this:
>
> [INFO ] GET     "/admin/entities?status=active&entity_type=corporation" 
>  for 127.0.0.1  at 2015-06-11 22:20:19 -0400
> [DEBUG]   SQL (0.6ms)  USE [YCOR_DEV]
> [INFO ] === Processing by Admin::EntitiesController#index as HTML
> [INFO ]   Parameters: {"status"=>"active", "entity_type"=>"corporation"}
> DEBUG]   Entity Load (7701.7ms)  EXEC sp_executesql N'SELECT TOP (50) 
> [__rnt].* FROM ( SELECT ROW_NUMBER() OVER (ORDER BY fileno DESC) AS [__rn], 
> [entities].* FROM [entities] WHERE (entities.entity_type = 
> N''corporation'') ) AS [__rnt] WHERE [__rnt].[__rn] > (0) ORDER BY 
> [__rnt].[__rn] ASC'
>
>
> There's no sign of the *status* parameter. 
>
> Am I missing something basic here? 
>
> Thanks,
> Tim
>
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to