exercism/exercism.io — pull request #2035 by bluerogue251 (2014-11-15 03:40:42+00:00)
Title: DRY up random key generation

* Make random key generation the responsibility of the new RandomKey class
* Remove that responsibility from ActiveRecord classes

Here are some things I like about this change:
* Closer to following single responsibility principle
* Removes duplication of code

Here are some things I am hesitant about:
* Am I requiring the file correctly in `lib/exercism.rb`?
* Is `lib/exercism/random_key.rb` the right place for the `RandomKey` file to live? (Since it's sort of like a utility, not really application-specific logic).
* Not sure how I feel about `RandomKey.generate` as a class method, vs. an instance method, or maybe `RandomKey` should actually be a module and not a class? Not sure about it.
* I didn't write any new tests because I consider this just a refactoring without changing behaviour.