Closed brentvatne closed 12 years ago
I started writing a response, but thought it would be much better to get ticket #58 complete before we wrap up this feature. Then both the zip and markdown files can use the Puzzle slug as their names. That is much more desirable then '2.zip' and '2.markdown'.
@brentvatne Would you mind taking a stab at that ticket? If not I'll see if I can find someone to get that done so we can use the stub data here.
@jordanbyron: Sure, I'm busy for the next couple of days at work but I will get that one done asap.
@brentvatne Great. Once you are done with that we can resume work on this. Let me know if you get stuck or are too busy to finish it.
@jordanbyron 985c7d0 represents a nearly complete patch I believe. This turned out to take longer than expected, oh well :satisfied:
Some notes and questions:
PuzzleFile::Description
, PuzzleFile::Zipped
/test/bare_test_runner.rb
(should probably change this so it loads the tests in random order using some built in runner, just requiring for now). Since this was pretty test driven to be sure everything was working properly every step along the way, I was getting tired of loading the Rails environment. It might be nice to do this with more of our unit tests.before_save
callback does not seem to be working as I expected: I wanted it to call delete_related_files
any time I update a Puzzle
, so I can delete the old files and re-create them. Am I using the right callback and doing something else wrong, or should I be using a different callback? def delete_old_files
old_puzzle = dup.reinitialize_files
old_puzzle.slug = slug_was || slug
old_puzzle.delete_related_files
end
This patch will not die in vain
As per the discussion in issue #55
Summary of new features proposed
Code not yet ready to be merged, missing zip functionality.
Pending for discussion