Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gws change #40

Merged
merged 4 commits into from May 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,6 +7,7 @@ tmp/*
.DS_Store
public/assets
.rubocop.yml
db/scraper/*

# Ignore application configuration
/config/application.yml
3 changes: 2 additions & 1 deletion app/models/vendor_vintage.rb
Expand Up @@ -15,6 +15,7 @@ def create_or_update_price(attrs)
end

existing_vendor_vintage

end

private
Expand All @@ -35,7 +36,7 @@ def find_by_wine_and_year(vendor_vintage_attrs)
has_many :vendor_critics, dependent: :destroy

validates_presence_of :vendor_wine

after_save :log_results_of_save

def price_has_changed_from(price_cents)
Expand Down
11 changes: 11 additions & 0 deletions db/migrate/20180505135624_add_lwin_to_wine.rb
@@ -0,0 +1,11 @@
class AddLwinToWine < ActiveRecord::Migration[5.1]
def change
add_column :wines, :lwin, :string
remove_column :vendor_vintages, :lwin, :string

add_column :vendor_wines, :gws_id, :string
remove_column :vendor_vintages, :gws_id, :string
remove_column :vendor_vintages, :journalist_names, :string
remove_column :vintages, :lwin, :string
end
end
8 changes: 3 additions & 5 deletions db/schema.rb
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180503202532) do
ActiveRecord::Schema.define(version: 20180505135624) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -94,11 +94,8 @@
t.string "website"
t.bigint "vendor_wine_id"
t.date "launch_date"
t.string "lwin"
t.string "lwin_11"
t.string "gws_id"
t.string "confidence_index"
t.string "journalist_names"
t.string "journalist_count"
t.index ["vendor_wine_id"], name: "index_vendor_vintages_on_vendor_wine_id"
end
Expand All @@ -111,6 +108,7 @@
t.text "description"
t.bigint "wine_id"
t.string "website"
t.string "gws_id"
t.index ["wine_id"], name: "index_vendor_wines_on_wine_id"
end

Expand All @@ -122,7 +120,6 @@
t.string "status"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "lwin"
t.string "lwin_11"
t.string "confidence_index"
t.index ["wine_id"], name: "index_vintages_on_wine_id"
Expand All @@ -148,6 +145,7 @@
t.string "gws_id"
t.string "colour"
t.string "country"
t.string "lwin"
t.index ["appellation_id"], name: "index_wines_on_appellation_id"
end

Expand Down