I'm using ActiveScaffold extensively over a legacy oracle schema. Mostly it works well, but one issue this legacy schema has introduced is that all the column names have a standard prefix - eg, all the columns in the Company table have a prefix of comp_ (comp_id, comp_name etc)
I have (seperate from ActiveScaffold) a method that sets up accessors for all of these automatically with the prefix's removed which works reasonably well. However, when using ActiveScaffold, the sortable? method returns false for these columns causing them to not be sortable by default (as they don't match the column names exactly I guess). This is easily remedied on an individual basis using sort_by. eg config.columns[:name].sort_by :method => 'comp_name' Once that is specified, the native ActiveScaffold sorting works fine - however, I don't want to have to define this for every column in every active_scaffold block if I don't have to. The only way I can think of dealing with this is to alias the active_scaffold method and iterate thru config.column setting the sort_by after the call to the original method. Is there a cleaner/better way of setting a prefix for something like this to be checked or is this a reasonable approach? Cheers Dave Smylie -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
