Permalink
Browse files

populate enclosures table during migration

  • Loading branch information...
1 parent b6590d1 commit 5ff194fbd45a6da1e115ad6940af185d87a90801 @mmb committed Sep 7, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 db/migrate/20110906003222_create_enclosures.rb
@@ -1,3 +1,5 @@
+require 'murlsh'
+
class CreateEnclosures < ActiveRecord::Migration
def self.up
@@ -11,6 +13,16 @@ def self.up
end
add_index :enclosures, :url_id
+
+ # populate
+ require './plugins/add_pre_55_enclosure_self.rb'
+ require './plugins/add_pre_55_enclosure_vimeo.rb'
+ require './plugins/add_pre_55_enclosure_youtube.rb'
+
+ Murlsh::Url.find(:all).each do |u|
+ Murlsh::Plugin.hooks('add_pre') { |p| p.run u, {} }
+ u.save!
+ end
end
def self.down

0 comments on commit 5ff194f

Please sign in to comment.