provideal / tabulatr

A tight DSL to build tables of ActiveRecord or Mongoid models with sorting, pagination, finding/filtering, selecting and batch actions. Tries to do for tables what formtastic and simple_form did for forms.
Other
160 stars 15 forks source link

Adapter strategy #32

Closed plukevdh closed 12 years ago

plukevdh commented 12 years ago

The Tabulatr::Finder.find_for_table method is a complete clusterfuck with no easy means of extending if I wanted to use, say mongomapper, datamapper or any other ORM rather than mongoid/AR.

Extracted functionality into adapter classes.

That method still ought to be refactored massively. This is a start and leaves room for extendability.

Also, why the weird conditions (tralse?) in your tests? You do know you can filter tests by line number with rspec right? I can pull that out of this commit if it would help it get merged in, but I don't understand why those are in there.

Also made running Mongo tests over AR easier by looking for an env var rather than a temp file. Can simply run w/ USE_MONGOID=true rspec

no-dashes commented 12 years ago

Hey plukevdh, thanks a lot for the effort! Mongoid support was really a quick hack, I very much appreciate your adapter strategy. The tralse-WTF was just handy during initial development, I don't miss it ;)

plukevdh commented 12 years ago

Also ALSO: thanks for the pull.

no-dashes commented 12 years ago

Heyho, Version 0.4.1 fixes that. Even the specs work with 1.8.7 ;)