Field search on virtual attribute

49 views
Skip to first unread message

Jim

unread,
Feb 9, 2019, 5:55:12 PM2/9/19
to ActiveScaffold : Ruby on Rails Gem
I think I've come across a bug in searching on a virtual column.  It seems that search_sql has to be set to something in order for the field to show up in the field search form. However, if I use a proc, condition_for_column (lib/active_scaffold/finder.rb) runs the proc but doesn't just return the built condition, but continues on through and calls column.search_sql.collect, which errors because search_sql is a proc and can't be collected. 

If I use self.condition_for_week_column (week is the virtual attribute), that is detected, executed, and the conditions are returned properly. However, search_sql still has to be set to something in order for the field to show in the search form.

Jim Crate

Sergio Cambra

unread,
Feb 11, 2019, 10:29:35 AM2/11/19
to actives...@googlegroups.com, Jim

Hi Jim

 

Proc is not supported for search_sql:

https://github.com/activescaffold/active_scaffold/wiki/API:-Column#search_sql

 

Regards

--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails Gem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activescaffol...@googlegroups.com.
To post to this group, send email to actives...@googlegroups.com.
Visit this group at https://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.



Reply all
Reply to author
Forward
0 new messages