Skip to content
Browse files

Fix generator and migration

  • Loading branch information...
1 parent 61741c2 commit 3ab526976e0a4730af0eec63c10c32067a84abab @mmangino mmangino committed
View
4 generators/publisher/publisher_generator.rb
@@ -4,7 +4,9 @@ def manifest
m.directory "app/models"
m.template "publisher.rb", "app/models/#{file_name}_publisher.rb"
migration_file_name="create_facebook_templates"
- unless m.migration_exists?(migration_file_name)
+ # unless m.migration_exists?(migration_file_name)
+ # THis should work, but it doesn't. So we re-implement it instead
+ if Dir.glob(File.join(RAILS_ROOT,"db","migrate","[0-9]*_*.rb")).grep(/[0-9]+_create_facebook_templates.rb$/).blank?
m.migration_template "create_facebook_templates.rb", "db/migrate", :migration_file_name=>migration_file_name
end
end
View
2 generators/publisher/templates/create_facebook_templates.rb
@@ -1,4 +1,4 @@
-class CreateFacebookTemplateRegistries < ActiveRecord::Migration
+class CreateFacebookTemplates < ActiveRecord::Migration
def self.up
create_table :facebook_templates, :force => true do |t|
t.string :bundle_id,:template_name

0 comments on commit 3ab5269

Please sign in to comment.
Something went wrong with that request. Please try again.