diff --git a/app/models/landing_page_image.rb b/app/models/landing_page_image.rb deleted file mode 100644 index a6cf2e541b..0000000000 --- a/app/models/landing_page_image.rb +++ /dev/null @@ -1,11 +0,0 @@ -class LandingPageImage < ActiveRecord::Base - attr_accessible :photo - has_attached_file :photo, styles: { max_common_res: ["1920x1080#", :jpg] }, - :convert_options => { max_common_res: "-quality 25" } - - validates_attachment_presence :photo - - def self.random - offset(rand(LandingPageImage.count)).first - end -end diff --git a/db/migrate/20140716051214_drop_landing_page_images.rb b/db/migrate/20140716051214_drop_landing_page_images.rb new file mode 100644 index 0000000000..d7324ed94b --- /dev/null +++ b/db/migrate/20140716051214_drop_landing_page_images.rb @@ -0,0 +1,16 @@ +class DropLandingPageImages < ActiveRecord::Migration + def up + drop_table :landing_page_images + end + + def down + create_table :landing_page_images do |t| + t.string :photo_file_name + t.string :photo_content_type + t.integer :photo_file_size + t.datetime :photo_updated_at + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index a9eddf99be..9a739d6577 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140702053145) do +ActiveRecord::Schema.define(:version => 20140716051214) do create_table "adjustment_metadata", :force => true do |t| t.integer "adjustment_id" @@ -296,15 +296,6 @@ ActiveRecord::Schema.define(:version => 20140702053145) do add_index "exchanges", ["receiver_id"], :name => "index_exchanges_on_receiver_id" add_index "exchanges", ["sender_id"], :name => "index_exchanges_on_sender_id" - create_table "landing_page_images", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "photo_file_name" - t.string "photo_content_type" - t.integer "photo_file_size" - t.datetime "photo_updated_at" - end - create_table "order_cycles", :force => true do |t| t.string "name" t.datetime "orders_open_at" diff --git a/db/seeds.rb b/db/seeds.rb index a264245340..9e199be968 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -27,13 +27,6 @@ unless Spree::State.find_by_name 'Victoria' end end -# -- Landing page images -unless LandingPageImage.find_by_photo_file_name("potatoes.jpg") - LandingPageImage.create photo: File.open(File.join(Rails.root, "lib", "seed_data", "carrots.jpg")) - LandingPageImage.create photo: File.open(File.join(Rails.root, "lib", "seed_data", "tomatoes.jpg")) - LandingPageImage.create photo: File.open(File.join(Rails.root, "lib", "seed_data", "potatoes.jpg")) -end - -# -- Seeding suburbs +# -- Suburbs require_relative './suburb_seeds' SuburbSeeder.seed_suburbs unless Suburb.find_by_name("Dayton") diff --git a/spec/models/landing_page_image_spec.rb b/spec/models/landing_page_image_spec.rb deleted file mode 100644 index d4e2068cfa..0000000000 --- a/spec/models/landing_page_image_spec.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'spec_helper' - -describe LandingPageImage do - it { should have_attached_file(:photo) } - it { should validate_attachment_presence(:photo) } -end