| ## Script to remove failed / errors from resque | |
| class RemoveFailedJobs | |
| def self.from_resque(offset = 0, limit = 5000, name='Jobs::SampleJob') | |
| # Get the number of failed jobs: | |
| puts "Total number of failed jobs #{Resque::Failure.count}" | |
| # Returns an array of all the failures, paginated | |
| all_failures = Resque::Failure.all(offset, limit ) | |
| # Collect failures with array index as 'slot' |
| // layout file | |
| <body> | |
| <div class="container"> | |
| <%= flash_messages %> | |
| <%= yield %> | |
| </div><!-- /container --> | |
| </body> |
| #-----------IT TAKES AROUND 20 MIN ------------------- | |
| ## Associations are as follw :: | |
| ## Book ---> (has_many) FileSubmissions | |
| ## FileSubmission --> (has_one) FileDetail | |
| ## Flush all dependent records: | |
| FileDetail.delete_all | |
| FileSubmission.delete_all |
Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.