Add rake task for ad_banner. Will have ad_banner at dev:build
This commit is contained in:
parent
394099c388
commit
0af37c0688
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
After Width: | Height: | Size: 209 KiB |
|
@ -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
|
||||||
|
|
Reference in New Issue