power_shop 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/spec/controllers/cart_controller_spec.rb +56 -0
- data/spec/controllers/catalog_controller_spec.rb +77 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +28 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +3 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/secret_token.rb +1 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/schema.rb +105 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +85730 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/categories.rb +5 -0
- data/spec/factories/order.rb +4 -0
- data/spec/factories/products.rb +13 -0
- data/spec/factories/shopping_cart.rb +5 -0
- data/spec/lib/middleware/shopping_cart_spec.rb +25 -0
- data/spec/models/category_spec.rb +68 -0
- data/spec/models/order_item_spec.rb +13 -0
- data/spec/models/order_spec.rb +13 -0
- data/spec/models/product_spec.rb +24 -0
- data/spec/models/shop_image_spec.rb +11 -0
- data/spec/spec_helper.rb +31 -0
- metadata +382 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 20140828061556) do
|
15
|
+
|
16
|
+
# These are extensions that must be enabled in order to support this database
|
17
|
+
enable_extension "plpgsql"
|
18
|
+
|
19
|
+
create_table "categories", force: true do |t|
|
20
|
+
t.string "name", null: false
|
21
|
+
t.string "slug"
|
22
|
+
t.integer "parent_id"
|
23
|
+
t.integer "lft"
|
24
|
+
t.integer "rgt"
|
25
|
+
t.integer "depth"
|
26
|
+
t.text "description"
|
27
|
+
t.datetime "created_at"
|
28
|
+
t.datetime "updated_at"
|
29
|
+
t.integer "products_count", default: 0
|
30
|
+
end
|
31
|
+
|
32
|
+
add_index "categories", ["lft"], name: "index_categories_on_lft", using: :btree
|
33
|
+
add_index "categories", ["parent_id"], name: "index_categories_on_parent_id", using: :btree
|
34
|
+
add_index "categories", ["rgt"], name: "index_categories_on_rgt", using: :btree
|
35
|
+
add_index "categories", ["slug"], name: "index_categories_on_slug", unique: true, using: :btree
|
36
|
+
|
37
|
+
create_table "friendly_id_slugs", force: true do |t|
|
38
|
+
t.string "slug", null: false
|
39
|
+
t.integer "sluggable_id", null: false
|
40
|
+
t.string "sluggable_type", limit: 50
|
41
|
+
t.string "scope"
|
42
|
+
t.datetime "created_at"
|
43
|
+
end
|
44
|
+
|
45
|
+
add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true, using: :btree
|
46
|
+
add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", using: :btree
|
47
|
+
add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree
|
48
|
+
add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree
|
49
|
+
|
50
|
+
create_table "order_items", force: true do |t|
|
51
|
+
t.integer "order_id", null: false
|
52
|
+
t.integer "product_id"
|
53
|
+
t.string "product_title", null: false
|
54
|
+
t.float "price", null: false
|
55
|
+
end
|
56
|
+
|
57
|
+
add_index "order_items", ["order_id"], name: "index_order_items_on_order_id", using: :btree
|
58
|
+
|
59
|
+
create_table "orders", force: true do |t|
|
60
|
+
t.string "user_name"
|
61
|
+
t.string "user_phone"
|
62
|
+
t.string "user_email"
|
63
|
+
t.datetime "created_at"
|
64
|
+
t.datetime "updated_at"
|
65
|
+
end
|
66
|
+
|
67
|
+
create_table "products", force: true do |t|
|
68
|
+
t.integer "category_id", null: false
|
69
|
+
t.boolean "active", default: true
|
70
|
+
t.string "name", null: false
|
71
|
+
t.string "slug"
|
72
|
+
t.string "image"
|
73
|
+
t.text "description"
|
74
|
+
t.float "price", null: false
|
75
|
+
t.integer "sort", default: 500
|
76
|
+
t.datetime "created_at"
|
77
|
+
t.datetime "updated_at"
|
78
|
+
end
|
79
|
+
|
80
|
+
add_index "products", ["category_id"], name: "index_products_on_category_id", using: :btree
|
81
|
+
add_index "products", ["slug"], name: "index_products_on_slug", unique: true, using: :btree
|
82
|
+
|
83
|
+
create_table "shop_images", force: true do |t|
|
84
|
+
t.integer "subject_id", null: false
|
85
|
+
t.string "subject_type", null: false
|
86
|
+
t.string "image"
|
87
|
+
t.datetime "created_at"
|
88
|
+
t.datetime "updated_at"
|
89
|
+
end
|
90
|
+
|
91
|
+
add_index "shop_images", ["subject_id"], name: "index_shop_images_on_subject_id", using: :btree
|
92
|
+
|
93
|
+
create_table "shopping_cart_items", force: true do |t|
|
94
|
+
t.integer "owner_id"
|
95
|
+
t.string "owner_type"
|
96
|
+
t.integer "quantity"
|
97
|
+
t.integer "item_id"
|
98
|
+
t.string "item_type"
|
99
|
+
t.float "price"
|
100
|
+
end
|
101
|
+
|
102
|
+
create_table "shopping_carts", force: true do |t|
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
File without changes
|