Created
December 15, 2013 13:48
-
-
Save fidelix/7973280 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
desc 'Cria uns usuários, Títulos, Temporadas e Legendas fake pra facilitar...' | |
task :fake_stuff => :environment do | |
user = User.create!( | |
:username => 'Fidelix', | |
:email => '[email protected]', | |
:password => 'deserve2' | |
) | |
puts "Criado usuário" | |
title = Title.create!( | |
:name => 'Revolution', | |
:year => 2009, | |
:description => "Revolução do Caralho" | |
) | |
puts "Criada série" | |
season = Season.create!( | |
:number => 1, | |
:year => 2009, | |
:title => title | |
) | |
puts "Criada temporada" | |
subtitle = Subtitle.new( | |
:lang => "pt_BR", | |
:description => "Legendinha pra galera!", | |
:title => title, | |
:user => user, | |
:season => season, | |
:sub_file => File.open('/home/fidelix/downloads/Revolution.2012.S01E19.HDTV.XviD-FUM.srt') | |
) | |
release = Release.new( | |
:name => 'Revolution.2012.S01E19.HDTV.XviD-FUM', | |
:subtitle => subtitle | |
) | |
subtitle.releases = [release] | |
subtitle.save! | |
puts "Criada legenda" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment