Created
May 4, 2015 21:35
-
-
Save romulostorel/86e4746ee0c259e0111d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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