views 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +37 -0
  4. data/lib/generators/views/templates/view.sql +0 -0
  5. data/lib/generators/views/view_generator.rb +15 -0
  6. data/lib/tasks/views.rake +7 -0
  7. data/lib/views/version.rb +3 -0
  8. data/lib/views.rb +52 -0
  9. data/test/dummy/Rakefile +5 -0
  10. data/test/dummy/app/assets/javascripts/application.js +13 -0
  11. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  12. data/test/dummy/app/controllers/application_controller.rb +5 -0
  13. data/test/dummy/app/helpers/application_helper.rb +2 -0
  14. data/test/dummy/app/models/product.rb +2 -0
  15. data/test/dummy/app/views/layouts/application.html.erb +12 -0
  16. data/test/dummy/bin/bundle +3 -0
  17. data/test/dummy/bin/rails +4 -0
  18. data/test/dummy/bin/rake +4 -0
  19. data/test/dummy/bin/setup +29 -0
  20. data/test/dummy/config/application.rb +25 -0
  21. data/test/dummy/config/boot.rb +5 -0
  22. data/test/dummy/config/database.yml +10 -0
  23. data/test/dummy/config/database.yml.travis +12 -0
  24. data/test/dummy/config/environment.rb +5 -0
  25. data/test/dummy/config/environments/development.rb +41 -0
  26. data/test/dummy/config/environments/production.rb +79 -0
  27. data/test/dummy/config/environments/test.rb +42 -0
  28. data/test/dummy/config/initializers/assets.rb +11 -0
  29. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  30. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  31. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  32. data/test/dummy/config/initializers/inflections.rb +16 -0
  33. data/test/dummy/config/initializers/mime_types.rb +4 -0
  34. data/test/dummy/config/initializers/session_store.rb +3 -0
  35. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  36. data/test/dummy/config/locales/en.yml +23 -0
  37. data/test/dummy/config/routes.rb +56 -0
  38. data/test/dummy/config/secrets.yml +22 -0
  39. data/test/dummy/config.ru +4 -0
  40. data/test/dummy/db/migrate/20161017172847_create_products.rb +10 -0
  41. data/test/dummy/db/schema.rb +26 -0
  42. data/test/dummy/db/views/guitars.sql +7 -0
  43. data/test/dummy/log/development.log +68 -0
  44. data/test/dummy/log/test.log +1138 -0
  45. data/test/dummy/public/404.html +67 -0
  46. data/test/dummy/public/422.html +67 -0
  47. data/test/dummy/public/500.html +66 -0
  48. data/test/dummy/public/favicon.ico +0 -0
  49. data/test/generators_test.rb +19 -0
  50. data/test/tasks_test.rb +28 -0
  51. data/test/test_helper.rb +14 -0
  52. metadata +185 -0
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: a462a71b37fda26c6c5bb2512ba1c4409a7e98106ec5544e659a214a830e818b30323861f5edac24b84eb94a3da0aceb5fe71324eb4162af1bdfb932791e82c1
15
+
16
+ test:
17
+ secret_key_base: bca8c7ab4adb2e383b8febce8f8890fe46d44424e69636ae5abe55b05a79a2109272a262560ad63df5f2575c459cc37107cbc5e6ad134be0191d58c0be70db7e
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,10 @@
1
+ class CreateProducts < ActiveRecord::Migration
2
+ def change
3
+ create_table :products do |t|
4
+ t.string :name
5
+ t.string :category
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,26 @@
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: 20161017172847) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "products", force: :cascade do |t|
20
+ t.string "name"
21
+ t.string "category"
22
+ t.datetime "created_at", null: false
23
+ t.datetime "updated_at", null: false
24
+ end
25
+
26
+ end
@@ -0,0 +1,7 @@
1
+
2
+ SELECT
3
+ products.*
4
+ FROM
5
+ products
6
+ WHERE
7
+ products.category = 'Guitar'
@@ -0,0 +1,68 @@
1
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
2
+ Migrating to CreateUsers (20161017172847)
3
+  (0.2ms) BEGIN
4
+  (25.2ms) CREATE TABLE "users" ("id" serial primary key, "name" character varying, "enabled" boolean, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
5
+  (0.1ms) ROLLBACK
6
+  (2.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
7
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
8
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
9
+ Migrating to CreateUsers (20161017172847)
10
+  (0.1ms) BEGIN
11
+  (2.4ms) CREATE TABLE "users" ("id" serial primary key, "name" character varying, "enabled" boolean, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
12
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
13
+  (6.3ms) COMMIT
14
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
15
+  (1.7ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
16
+ FROM pg_constraint c
17
+ JOIN pg_class t1 ON c.conrelid = t1.oid
18
+ JOIN pg_class t2 ON c.confrelid = t2.oid
19
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
20
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
21
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
22
+ WHERE c.contype = 'f'
23
+ AND t1.relname = 'users'
24
+ AND t3.nspname = ANY (current_schemas(false))
25
+ ORDER BY c.conname
26
+ 
27
+  (2.3ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
28
+  (12.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
29
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
30
+ Migrating to CreateProducts (20161017172847)
31
+  (0.2ms) BEGIN
32
+  (7.4ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
33
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
34
+  (0.5ms) COMMIT
35
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
36
+  (1.8ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
37
+ FROM pg_constraint c
38
+ JOIN pg_class t1 ON c.conrelid = t1.oid
39
+ JOIN pg_class t2 ON c.confrelid = t2.oid
40
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
41
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
42
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
43
+ WHERE c.contype = 'f'
44
+ AND t1.relname = 'products'
45
+ AND t3.nspname = ANY (current_schemas(false))
46
+ ORDER BY c.conname
47
+ 
48
+  (35.2ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
49
+  (12.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
50
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
51
+ Migrating to CreateProducts (20161017172847)
52
+  (0.2ms) BEGIN
53
+  (29.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) 
54
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
55
+  (6.1ms) COMMIT
56
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
57
+  (11.5ms) SELECT t2.oid::regclass::text AS to_table, a1.attname AS column, a2.attname AS primary_key, c.conname AS name, c.confupdtype AS on_update, c.confdeltype AS on_delete
58
+ FROM pg_constraint c
59
+ JOIN pg_class t1 ON c.conrelid = t1.oid
60
+ JOIN pg_class t2 ON c.confrelid = t2.oid
61
+ JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
62
+ JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
63
+ JOIN pg_namespace t3 ON c.connamespace = t3.oid
64
+ WHERE c.contype = 'f'
65
+ AND t1.relname = 'products'
66
+ AND t3.nspname = ANY (current_schemas(false))
67
+ ORDER BY c.conname
68
+