leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
537 stars 215 forks source link

Some small improvements: default scope + general case independent searching (Oracle) #231

Closed nathanvda closed 8 years ago

nathanvda commented 9 years ago

Hi Yuri, in my local branch I have added two small improvements:

I am working on a legacy rails app, on a legacy oracle database, so we have some kind of STI, but not in the rails way, so we define default scopes, and it is of course imperative we are able to use them.

The case independent searching I first solved by setting NLS_SORT and NLS_COMP to allow for case insensitive comparing and searching, which works. But this being a legacy database, a lot of primary keys are strings, and this had a very negative impact on overall performance.

My code: https://github.com/nathanvda/wice_grid/tree/add_default_scope_option

Would you be interested in this? In that case I will add a pull request. If you have any remarks, I would gladly take those into account.

leikind commented 9 years ago

Hey Nathan,

I've planned a series of modernizations and improvements for WiceGrid for July, I added your branch to the list of things to review/do. What version of Rails and WiceGrid does that legacy app run on?

Yuri

On Thu, Jul 2, 2015 at 11:15 AM, Nathan Van der Auwera < notifications@github.com> wrote:

Hi Yuri, in my local branch I have added two small improvements:

  • I added an option to use default scope
  • I added an option for a STRING_MATCHING_OPERATOR CI_LIKE which will compare by converting to uppercase.

I am working on a legacy rails app, on a legacy oracle database, so we have some kind of STI, but not in the rails way, so we define default scopes, and it is of course imperative we are able to use them.

The case independent searching I first solved by setting NLS_SORT and NLS_COMP to allow for case insensitive comparing and searching, which works. But this being a legacy database, a lot of primary keys are strings, and this had a very negative impact on overall performance.

My code: https://github.com/nathanvda/wice_grid/tree/add_default_scope_option

Would you be interested in this? In that case I will add a pull request. If you have any remarks, I would gladly take those into account.

— Reply to this email directly or view it on GitHub https://github.com/leikind/wice_grid/issues/231.

Best regards, Yuri Leikind

Sent from my Nokia 3310

nathanvda commented 9 years ago

Cool! I am using rails 3, so that side is not soooo legacy :)

leikind commented 8 years ago

Added in 3.6.0.pre4

https://github.com/leikind/wice_grid/wiki/What's-New-In-3.6.0