mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-17 00:07:24 +00:00
Remove landing page images
This commit is contained in:
@@ -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
|
||||
16
db/migrate/20140716051214_drop_landing_page_images.rb
Normal file
16
db/migrate/20140716051214_drop_landing_page_images.rb
Normal file
@@ -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
|
||||
11
db/schema.rb
11
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"
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe LandingPageImage do
|
||||
it { should have_attached_file(:photo) }
|
||||
it { should validate_attachment_presence(:photo) }
|
||||
end
|
||||
Reference in New Issue
Block a user