Skip to content

Instantly share code, notes, and snippets.

@romulostorel
Created May 4, 2015 21:35
Show Gist options
  • Save romulostorel/86e4746ee0c259e0111d to your computer and use it in GitHub Desktop.
Save romulostorel/86e4746ee0c259e0111d to your computer and use it in GitHub Desktop.
namespace :seed do
desc "Creating additional services"
task services: :environment do
stages.each do |stage|
StageAction.create(stage: stage, product: protheus, name: 'sql', label: 'sql')
StageAction.create(stage: stage, product: protheus, name: 'ini', label: 'ini')
StageAction.create(stage: stage, product: fluig, name: 'change_port', label: 'change_port')
StageAction.create(stage: stage, product: fluig, name: 'change_dns', label: 'change_dns')
end
end
end
private
def stages
Stage.all
end
def protheus
Product.where(name:'protheus').first
end
def fluig
Product.where(name:'fluig').first
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment