21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/generators/socialization/socialization_generator.rb', line 21
def create_migration_file
options[:store].downcase!
unless STORES.include?(options[:store])
puts "Invalid store '#{options[:store]}'. The following stores are valid: #{STORES.join(', ')}."
exit 1
end
copy_file "#{options[:store]}/model_follow.rb", 'app/models/follow.rb'
copy_file "#{options[:store]}/model_like.rb", 'app/models/like.rb'
copy_file "#{options[:store]}/model_mention.rb", 'app/models/mention.rb'
if options[:store] == 'active_record'
migration_template "#{options[:store]}/migration_follows.rb", 'db/migrate/create_follows.rb'
sleep 1 migration_template "#{options[:store]}/migration_likes.rb", 'db/migrate/create_likes.rb'
sleep 1 migration_template "#{options[:store]}/migration_mentions.rb", 'db/migrate/create_mentions.rb'
end
end
|