tombenner/rails-datatables — pull request #2 by antillas21 (2014-05-17 03:58:54+00:00)
Title: Adds Rspec test suite and flexibility of options to initialize a RailsDatatables inherited class

Hi Tom Benner,

I liked the changes you added in your gem version from the original repo, and thought you could use the following:

* a test suite to ensure proper functionality
* additional flexibility to `RailsDatatables` inherited classes. See [here](https://github.com/antillas21/rails-datatables#additional-notes) for examples of this flexibility.

I am aware that perhaps you may reject this contribution, given it changes a lot of things. For example:
* namespaces base class to `RailsDatatables::Base` and generated classes inherit from it.
* edits generator name to `DatatableGenerator`, in order to have a simpler command line call:
`$ rails generate datatable NAME`

* changes to the `RailsDatatables::Base#initialize` method. `@sort_columns` and `@searchable_columns` are no longer assigned at initialization, but have been moved into their own memoized methods.
* removes dependency to provide an existing model/class to the generator in order to create a datatable class. This provides flexibility in naming derived classes and use cases.

I hope you like the end result.

I am aware that I took a lot of liberty with your code. To my favor, I have to say that I was working recently in a Rails project where jQuery.dataTables was heavily implemented and had to deal with far more complex scenarios than passing a model to derive record retrieval (thus, the options hash idea in the `#initialize` method and not tying the resulting classes to an existing Rails model).

Looking forward to your comments :smile: