Skip to content

Commit

Permalink
Remove default price from articles table
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Altmann committed Mar 12, 2015
1 parent 3795310 commit 99c3497
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 16 deletions.
6 changes: 5 additions & 1 deletion app/views/articles/form/_common_inputs.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
.Accordion-step
= f.input :quantity, tooltip: true, input_html: { class: 'JS-enforce-input-constraints' }
.Accordion-step
= f.input :price, tooltip: true, input_html: { value: number_with_precision(f.object.price, precision: 2), class: 'JS-remote-validate-blur' }, required: true
= f.input :price, tooltip: true,
input_html: { value: number_with_precision(f.object.price, precision: 2),
placeholder: "0,00",
class: "JS-remote-validate-blur" },
required: true
- if current_user.is_a?(LegalEntity)
.Accordion-step
= f.input :basic_price, tooltip: true, input_html: { value: number_with_precision(f.object.basic_price, precision: 2) }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class RemovePriceDefaultFromArticles < ActiveRecord::Migration
def up
change_column_default(:articles, :price_cents, nil)
end

def down
change_column_default(:articles, :price_cents, 100)
end
end
43 changes: 28 additions & 15 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150226095925) do
ActiveRecord::Schema.define(version: 20150312124515) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -39,7 +39,7 @@
t.datetime "updated_at", null: false
t.integer "user_id", limit: 8
t.string "condition"
t.integer "price_cents", limit: 8, default: 100
t.integer "price_cents", limit: 8
t.string "currency"
t.boolean "fair", default: false
t.string "fair_kind"
Expand Down Expand Up @@ -92,9 +92,9 @@
t.boolean "borrowable", default: false
t.integer "comments_count", default: 0
t.integer "original_id", limit: 8
t.boolean "payment_voucher", default: false
t.boolean "transport_bike_courier", default: false
t.integer "transport_bike_courier_number", default: 1
t.boolean "payment_voucher", default: false
end

add_index "articles", ["created_at"], name: "index_articles_on_created_at", using: :btree
Expand All @@ -114,12 +114,12 @@

create_table "business_transactions", force: true do |t|
t.string "type_fix"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "expire"
t.string "selected_transport"
t.string "selected_payment"
t.boolean "tos_accepted", default: false
t.boolean "tos_accepted", default: false
t.integer "buyer_id", limit: 8
t.string "state"
t.text "message"
Expand All @@ -135,20 +135,20 @@
t.string "country"
t.integer "seller_id", limit: 8
t.datetime "sold_at"
t.boolean "purchase_emails_sent", default: false
t.boolean "purchase_emails_sent", default: false
t.string "address_suffix"
t.integer "discount_id"
t.integer "discount_value_cents"
t.boolean "billed_for_fair", default: false
t.boolean "billed_for_fee", default: false
t.boolean "billed_for_discount", default: false
t.boolean "billed_for_fair", default: false
t.boolean "billed_for_fee", default: false
t.boolean "billed_for_discount", default: false
t.integer "line_item_group_id", limit: 8
t.boolean "refunded_fair", default: false
t.boolean "refunded_fee", default: false
t.boolean "tos_bike_courier_accepted", default: false
t.boolean "refunded_fair", default: false
t.boolean "refunded_fee", default: false
t.boolean "tos_bike_courier_accepted", default: false
t.text "bike_courier_message"
t.string "bike_courier_time", limit: nil
t.boolean "courier_emails_sent", default: false
t.string "bike_courier_time"
t.boolean "courier_emails_sent", default: false
t.datetime "courier_emails_sent_at"
end

Expand Down Expand Up @@ -428,6 +428,19 @@

add_index "notices", ["user_id"], name: "index_notices_on_user_id", using: :btree

create_table "opening_times", force: true do |t|
t.integer "user_id", limit: 8
t.string "monday"
t.string "tuesday"
t.string "wednesday"
t.string "thursday"
t.string "friday"
t.string "saturday"
t.string "sunday"
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "payments", force: true do |t|
t.string "pay_key"
t.string "state"
Expand Down

0 comments on commit 99c3497

Please sign in to comment.