Add rake task for ad_banner. Will have ad_banner at dev:build

This commit is contained in:
Matthew Kaito Juyuan Fu 2012-02-03 18:02:27 +08:00 committed by Christophe Vilayphiou
parent 394099c388
commit 0af37c0688
3 changed files with 4 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

View File

@ -127,7 +127,10 @@ namespace :dev do
AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[1].id, :key => 'department', :en => 'Computer Science', :zh_tw => '計算機科學' ) AttributeValue.create( :user_id => user.id, :attribute_field_id => sr_2_1.attribute_fields[1].id, :key => 'department', :en => 'Computer Science', :zh_tw => '計算機科學' )
ad_banner = AdBanner.new(:title => 'banner_1',:post_date => Date.today,:context=> "context",:ad_fx=>'zoom',:direct_to_after_click=>true)
ad_banner.ad_images.build(:time_to_next=>2,:picture_intro=>'Banner1',:out_link=>'http://www.rulingcom.com/main.php',:file => File.open("#{Rails.root}/lib/ad_banner/ad_banner1.jpg",:link_open=>'new_window'))
ad_banner.ad_images.build(:time_to_next=>5,:picture_intro=>'Banner2',:out_link=>'http://www.google.com',:file => File.open("#{Rails.root}/lib/ad_banner/ad_banner2.jpg",:link_open=>'local'))
ad_banner.save!
end end
end end