Created
February 28, 2012 14:41
-
-
Save Capncavedan/1932894 to your computer and use it in GitHub Desktop.
How to create a set of ImageRight diary items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# UPDATED May 16 2012 for ImageRight v5 | |
# How to generate a set of diary items for agencies | |
# Use rails console, paste list of agency ids into %w below | |
# Adjust other parameters as appropriate | |
# IMPORTANT: left pad with zeros to make agency ids 5 digits | |
agency_ids = %w( ).map{|a| a.to_s.rjust(5, '0')}.uniq.sort | |
diary_items = [] | |
agency_ids.each do |agency_id| | |
diary_items << ImageRightDiaryItem.new( | |
file_number: agency_id, | |
drawer: 'AgencyFiles', | |
file_type: 'AgencyFiles', | |
description: 'Follow up on signed LOI', | |
diary_datetime: '2012-07-01 09:00:00', | |
user_id: 'CSMYTH') | |
end | |
diary_items.each do |item| | |
item.deliver | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment