documentcloud/documentcloud — pull request #84 by dannguyen (2014-01-07 02:33:17+00:00)
Title: refactored document.rb a bit

Some house cleaning to make it easier to test individual components as DC migrates to Rails 4. I made some DocumentConcerns and arbitrarily moved sections of document.rb into them. The only thing I can say is that the tests still pass and I even fixed a failing test.

I also added some gems, which may not be cool. Pry, because how can you not have it. And 'string_ex', which I saw was being used by RapGenius in their template app, so maybe that's not a good thing. But it does seem to have robust Unicode conversion that may be easier to test/maintain than what was in `ensure_slugged`...Since `ensure_slugged` was only an after_create call, I'm assuming this won't impact legacy slugs.

https://github.com/rsl/stringex

I also don't know how to use postgres so I kept getting an error about `remote_urls - PG::UndefinedTable: ERROR: relation "remote_urls" does not exist`...even though I tried to manually generate it from the included SQL and schema. Otherwise, tests pass for now.