gonzales 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +23 -0
- data/README.md +107 -0
- data/Rakefile +38 -0
- data/lib/gonzales/collection.rb +70 -0
- data/lib/gonzales/factories.rb +57 -0
- data/lib/gonzales/factory_girl/definition_proxy.rb +77 -0
- data/lib/gonzales/test_helper.rb +51 -0
- data/lib/gonzales/version.rb +3 -0
- data/lib/gonzales.rb +72 -0
- data/lib/tasks/gonzales_tasks.rake +7 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/models/hat.rb +3 -0
- data/test/dummy/app/models/material.rb +3 -0
- data/test/dummy/app/models/outfit.rb +6 -0
- data/test/dummy/app/models/shoe.rb +6 -0
- data/test/dummy/app/models/wardrobe.rb +3 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20121005205521_create_hats.rb +10 -0
- data/test/dummy/db/migrate/20121009054201_create_materials.rb +9 -0
- data/test/dummy/db/migrate/20121009055333_create_shoes.rb +16 -0
- data/test/dummy/db/migrate/20121009091652_create_outfits.rb +13 -0
- data/test/dummy/db/migrate/20121010161218_create_hats_outfits.rb +10 -0
- data/test/dummy/db/migrate/20121011131629_create_wardrobes.rb +9 -0
- data/test/dummy/db/migrate/20121011131724_add_wardrobe_to_outfit.rb +5 -0
- data/test/dummy/db/schema.rb +69 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +571 -0
- data/test/dummy/log/test.log +20542 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/factories/hats.rb +14 -0
- data/test/dummy/test/factories/materials.rb +11 -0
- data/test/dummy/test/factories/outfits.rb +16 -0
- data/test/dummy/test/factories/shoes.rb +16 -0
- data/test/dummy/test/factories/wardrobes.rb +7 -0
- data/test/dummy/test/speedy.rb +7 -0
- data/test/dummy/test/unit/hat_test.rb +14 -0
- data/test/dummy/test/unit/material_test.rb +7 -0
- data/test/dummy/test/unit/outfit_test.rb +36 -0
- data/test/dummy/test/unit/shoe_test.rb +13 -0
- data/test/dummy/test/unit/wardrobe_test.rb +7 -0
- data/test/dummy/tmp/speedy.yml +16 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/gonzales/collection_test.rb +81 -0
- data/test/unit/gonzales/factories_test.rb +53 -0
- data/test/unit/gonzales/factory_girl/definition_proxy_test.rb +106 -0
- data/test/unit/gonzales/test_helper_test.rb +44 -0
- data/test/unit/gonzales_test.rb +15 -0
- metadata +251 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
Dummy::Application.routes.draw do
|
2
|
+
# The priority is based upon order of creation:
|
3
|
+
# first created -> highest priority.
|
4
|
+
|
5
|
+
# Sample of regular route:
|
6
|
+
# match 'products/:id' => 'catalog#view'
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
8
|
+
|
9
|
+
# Sample of named route:
|
10
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
11
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
+
|
13
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
14
|
+
# resources :products
|
15
|
+
|
16
|
+
# Sample resource route with options:
|
17
|
+
# resources :products do
|
18
|
+
# member do
|
19
|
+
# get 'short'
|
20
|
+
# post 'toggle'
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# collection do
|
24
|
+
# get 'sold'
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
|
28
|
+
# Sample resource route with sub-resources:
|
29
|
+
# resources :products do
|
30
|
+
# resources :comments, :sales
|
31
|
+
# resource :seller
|
32
|
+
# end
|
33
|
+
|
34
|
+
# Sample resource route with more complex sub-resources
|
35
|
+
# resources :products do
|
36
|
+
# resources :comments
|
37
|
+
# resources :sales do
|
38
|
+
# get 'recent', :on => :collection
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
|
42
|
+
# Sample resource route within a namespace:
|
43
|
+
# namespace :admin do
|
44
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
45
|
+
# # (app/controllers/admin/products_controller.rb)
|
46
|
+
# resources :products
|
47
|
+
# end
|
48
|
+
|
49
|
+
# You can have the root of your site routed with "root"
|
50
|
+
# just remember to delete public/index.html.
|
51
|
+
# root :to => 'welcome#index'
|
52
|
+
|
53
|
+
# See how all your routes lay out with "rake routes"
|
54
|
+
|
55
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
+
# match ':controller(/:action(/:id))(.:format)'
|
58
|
+
end
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateShoes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :shoes do |t|
|
4
|
+
t.string :name
|
5
|
+
t.belongs_to :upper_material
|
6
|
+
t.belongs_to :lower_material
|
7
|
+
t.belongs_to :inner_material
|
8
|
+
t.integer :size
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
add_index :shoes, :upper_material_id
|
13
|
+
add_index :shoes, :lower_material_id
|
14
|
+
add_index :shoes, :inner_material_id
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,69 @@
|
|
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 to check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(:version => 20121011131724) do
|
15
|
+
|
16
|
+
create_table "hats", :force => true do |t|
|
17
|
+
t.string "brim_type"
|
18
|
+
t.integer "size"
|
19
|
+
t.datetime "created_at", :null => false
|
20
|
+
t.datetime "updated_at", :null => false
|
21
|
+
end
|
22
|
+
|
23
|
+
create_table "hats_outfits", :force => true do |t|
|
24
|
+
t.integer "hat_id"
|
25
|
+
t.integer "outfit_id"
|
26
|
+
end
|
27
|
+
|
28
|
+
add_index "hats_outfits", ["hat_id"], :name => "index_hats_outfits_on_hat_id"
|
29
|
+
add_index "hats_outfits", ["outfit_id"], :name => "index_hats_outfits_on_outfit_id"
|
30
|
+
|
31
|
+
create_table "materials", :force => true do |t|
|
32
|
+
t.string "name"
|
33
|
+
t.datetime "created_at", :null => false
|
34
|
+
t.datetime "updated_at", :null => false
|
35
|
+
end
|
36
|
+
|
37
|
+
create_table "outfits", :force => true do |t|
|
38
|
+
t.string "style"
|
39
|
+
t.integer "shoe_id"
|
40
|
+
t.integer "hat_id"
|
41
|
+
t.datetime "created_at", :null => false
|
42
|
+
t.datetime "updated_at", :null => false
|
43
|
+
t.integer "wardrobe_id"
|
44
|
+
end
|
45
|
+
|
46
|
+
add_index "outfits", ["hat_id"], :name => "index_outfits_on_hat_id"
|
47
|
+
add_index "outfits", ["shoe_id"], :name => "index_outfits_on_shoe_id"
|
48
|
+
|
49
|
+
create_table "shoes", :force => true do |t|
|
50
|
+
t.string "name"
|
51
|
+
t.integer "upper_material_id"
|
52
|
+
t.integer "lower_material_id"
|
53
|
+
t.integer "inner_material_id"
|
54
|
+
t.integer "size"
|
55
|
+
t.datetime "created_at", :null => false
|
56
|
+
t.datetime "updated_at", :null => false
|
57
|
+
end
|
58
|
+
|
59
|
+
add_index "shoes", ["inner_material_id"], :name => "index_shoes_on_inner_material_id"
|
60
|
+
add_index "shoes", ["lower_material_id"], :name => "index_shoes_on_lower_material_id"
|
61
|
+
add_index "shoes", ["upper_material_id"], :name => "index_shoes_on_upper_material_id"
|
62
|
+
|
63
|
+
create_table "wardrobes", :force => true do |t|
|
64
|
+
t.string "name"
|
65
|
+
t.datetime "created_at", :null => false
|
66
|
+
t.datetime "updated_at", :null => false
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
Binary file
|