Revision 723:d41bf754c0f2 vendor/plugins/redmine_bibliography/lib/tasks

View differences:

vendor/plugins/redmine_bibliography/lib/tasks/seed_bibtex_entry_types.rake
1
namespace :redmine do
2
  namespace :plugins do
3
    namespace :redmine_bibliography do
4

  
5
      task :seed_bibtex_entry_types  => :environment do    
6
        desc "Seeds the Bibtex Entry Types Table"
7
  
8
        quoted = ActiveRecord::Base.connection.quote_table_name('bibtex_entry_types')
9
        ActiveRecord::Base.connection.execute("TRUNCATE #{quoted}")
10

  
11
        open(File.dirname(__FILE__) + "/../../db/seed_data/bibtex_entry_types_list.txt") do |bibtex_entry_types|
12
          bibtex_entry_types.read.each_line do |bibtex_entry_type|
13
            BibtexEntryType.create(:name => bibtex_entry_type.chomp)
14
          end
15
        end
16
      end 
17

  
18
    end 
19
  end
20
end

Also available in: Unified diff