added suppliers, weight to item

This commit is contained in:
Senad Uka
2015-03-14 06:33:49 +01:00
parent 0bafbb4b2f
commit e7793f0884
17 changed files with 304 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
class AddWeigthToItem < ActiveRecord::Migration
def change
add_column :items, :weight, :decimal, precision: 5, scale: 3
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150313065130) do
ActiveRecord::Schema.define(version: 20150314033743) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -87,6 +87,8 @@ ActiveRecord::Schema.define(version: 20150313065130) do
t.datetime "updated_at", null: false
t.string "tags"
t.json "traits"
t.integer "supplier_id"
t.decimal "weight", precision: 5, scale: 3
end
create_table "media_types", force: :cascade do |t|
@@ -118,6 +120,19 @@ ActiveRecord::Schema.define(version: 20150313065130) do
t.integer "category_id"
end
create_table "suppliers", force: :cascade do |t|
t.string "name"
t.string "address"
t.string "postal_code"
t.string "town"
t.string "phone"
t.string "contact_person"
t.string "email"
t.text "note"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "units", force: :cascade do |t|
t.string "name"
t.string "short_name", limit: 4

View File

@@ -1,4 +1,5 @@
class User < ActiveRecord::Base
has_many :carts
has_secure_password
validates_presence_of :first_name, :last_name, :password, :email, :password_confirmation