|
|
|
|
|
by nagnatron
5209 days ago
|
|
You're right that it's similar to extracting it to a module since (in this example) HashGenerator.new is evaluated with the class and in my Request spec I can't exactly stub HashGenerator.new to return a double. How would you do it? |
|
That way you don't have the indirection of an ActiveRecord callback and you have your process of creating a request and assigning it a unique hash in a straightforward single process.