views 4.0.0.0 → 4.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/view/view_generator.rb +1 -1
- data/lib/views/railtie.rb +12 -10
- data/lib/views/version.rb +1 -1
- data/test/dummy/config/database.yml +5 -2
- data/test/dummy/log/test.log +131 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f5a7800d9481e21156049f0c0e99a0eeb000e8f
|
4
|
+
data.tar.gz: c6087d37a0b6e7452053e1913f4968075ddb9158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e2b7aa325cec7a94f7699fff35b8e4e7557ada5041267447be4482fa91cd95b2f5f871c3cb8c6ce074b727e588a4d75e6ddbade19d12b1694bb7514e67c68b5
|
7
|
+
data.tar.gz: a34e17e6063a1e78f7ed40d98e1192d890917a92cafba985db39d6ad2c5d4704c5cd62d1bc2ecb749bca3ab61e33403e601952c966118e13e28def6ed3e5bf4b
|
@@ -2,7 +2,7 @@ require 'rails/generators'
|
|
2
2
|
|
3
3
|
module Views
|
4
4
|
module Generators
|
5
|
-
class ViewGenerator <
|
5
|
+
class ViewGenerator < Rails::Generators::NamedBase
|
6
6
|
include Rails::Generators::Migration
|
7
7
|
|
8
8
|
source_root File.expand_path('../templates', __FILE__)
|
data/lib/views/railtie.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
module Views
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
|
4
|
-
initializer 'views.
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
initializer 'views.active_record' do
|
5
|
+
ActiveSupport.on_load :active_record do
|
6
|
+
::ActiveRecord::Migration::CommandRecorder.include(
|
7
|
+
Views::Extensions::ActiveRecord::CommandRecorder
|
8
|
+
)
|
9
|
+
::ActiveRecord::ConnectionAdapters::AbstractAdapter.include(
|
10
|
+
Views::Extensions::ActiveRecord::AbstractAdapter
|
11
|
+
)
|
12
|
+
::ActiveRecord::SchemaDumper.prepend(
|
13
|
+
Views::Extensions::ActiveRecord::SchemaDumper
|
14
|
+
)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
|
16
18
|
end
|
data/lib/views/version.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -1766,3 +1766,134 @@ WHERE
|
|
1766
1766
|
category = 'Guitar'
|
1767
1767
|
|
1768
1768
|
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
1769
|
+
[1m[36mActiveRecord::SchemaMigration Load (2.8ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1770
|
+
[1m[35m (0.2ms)[0m BEGIN
|
1771
|
+
-----------------------------------
|
1772
|
+
GeneratorTest: test_file_generation
|
1773
|
+
-----------------------------------
|
1774
|
+
[1m[36m (0.2ms)[0m [1mROLLBACK[0m
|
1775
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1776
|
+
-------------------
|
1777
|
+
TaskTest: test_load
|
1778
|
+
-------------------
|
1779
|
+
[1m[36m (185.1ms)[0m [1mDROP DATABASE IF EXISTS "views_test"[0m
|
1780
|
+
[1m[35m (367.0ms)[0m CREATE DATABASE "views_test" ENCODING = 'utf8'
|
1781
|
+
[1m[36mSQL (0.3ms)[0m [1mCREATE EXTENSION IF NOT EXISTS "plpgsql"[0m
|
1782
|
+
[1m[35m (4.1ms)[0m CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
1783
|
+
[1m[36m (2.0ms)[0m [1mDROP VIEW IF EXISTS guitars[0m
|
1784
|
+
[1m[35m (7.4ms)[0m CREATE VIEW guitars AS
|
1785
|
+
SELECT
|
1786
|
+
*
|
1787
|
+
FROM
|
1788
|
+
products
|
1789
|
+
WHERE
|
1790
|
+
category = 'Guitar'
|
1791
|
+
|
1792
|
+
[1m[36m (19.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" character varying NOT NULL) [0m
|
1793
|
+
[1m[35m (1.0ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
1794
|
+
[1m[36m (0.3ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
1795
|
+
[1m[35m (0.4ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
|
1796
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20161017172847')[0m
|
1797
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.3ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1798
|
+
[1m[36m (0.5ms)[0m [1m SELECT c.relname as name, c.relkind AS type
|
1799
|
+
FROM pg_class c
|
1800
|
+
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
|
1801
|
+
WHERE c.relkind IN ('v')
|
1802
|
+
AND n.nspname = ANY (current_schemas(false))
|
1803
|
+
ORDER BY c.oid ASC
|
1804
|
+
[0m
|
1805
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1806
|
+
-------------------
|
1807
|
+
TaskTest: test_dump
|
1808
|
+
-------------------
|
1809
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1810
|
+
[1m[35m (1.8ms)[0m 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
|
1811
|
+
FROM pg_constraint c
|
1812
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
1813
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
1814
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
1815
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
1816
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
1817
|
+
WHERE c.contype = 'f'
|
1818
|
+
AND t1.relname = 'products'
|
1819
|
+
AND t3.nspname = ANY (current_schemas(false))
|
1820
|
+
ORDER BY c.conname
|
1821
|
+
|
1822
|
+
[1m[36m (0.3ms)[0m [1m SELECT c.relname as name, c.relkind AS type
|
1823
|
+
FROM pg_class c
|
1824
|
+
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
|
1825
|
+
WHERE c.relkind IN ('v')
|
1826
|
+
AND n.nspname = ANY (current_schemas(false))
|
1827
|
+
ORDER BY c.oid ASC
|
1828
|
+
[0m
|
1829
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1830
|
+
[1m[36m (1.3ms)[0m [1mSELECT 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
|
1831
|
+
FROM pg_constraint c
|
1832
|
+
JOIN pg_class t1 ON c.conrelid = t1.oid
|
1833
|
+
JOIN pg_class t2 ON c.confrelid = t2.oid
|
1834
|
+
JOIN pg_attribute a1 ON a1.attnum = c.conkey[1] AND a1.attrelid = t1.oid
|
1835
|
+
JOIN pg_attribute a2 ON a2.attnum = c.confkey[1] AND a2.attrelid = t2.oid
|
1836
|
+
JOIN pg_namespace t3 ON c.connamespace = t3.oid
|
1837
|
+
WHERE c.contype = 'f'
|
1838
|
+
AND t1.relname = 'products'
|
1839
|
+
AND t3.nspname = ANY (current_schemas(false))
|
1840
|
+
ORDER BY c.conname
|
1841
|
+
[0m
|
1842
|
+
[1m[35m (0.3ms)[0m SELECT c.relname as name, c.relkind AS type
|
1843
|
+
FROM pg_class c
|
1844
|
+
LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
|
1845
|
+
WHERE c.relkind IN ('v')
|
1846
|
+
AND n.nspname = ANY (current_schemas(false))
|
1847
|
+
ORDER BY c.oid ASC
|
1848
|
+
|
1849
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
1850
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1851
|
+
-----------------------------------
|
1852
|
+
MigrationTest: test_create_and_drop
|
1853
|
+
-----------------------------------
|
1854
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1855
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1856
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1857
|
+
Migrating to CreateGuitarsView (20161125151623)
|
1858
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1859
|
+
[1m[36m (12.3ms)[0m [1mDROP VIEW guitars[0m
|
1860
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161125151623"]]
|
1861
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1862
|
+
Migrating to CreateProducts (20161017172847)
|
1863
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
1864
|
+
[1m[36m (0.6ms)[0m [1mDROP TABLE "products"[0m
|
1865
|
+
[1m[35mSQL (0.2ms)[0m DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161017172847"]]
|
1866
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
1867
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
1868
|
+
Migrating to CreateProducts (20161017172847)
|
1869
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1870
|
+
[1m[35m (19.7ms)[0m CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
|
1871
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20161017172847"]]
|
1872
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1873
|
+
Migrating to CreateGuitarsView (20161125151623)
|
1874
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
1875
|
+
[1m[35m (0.7ms)[0m CREATE VIEW guitars AS
|
1876
|
+
SELECT
|
1877
|
+
*
|
1878
|
+
FROM
|
1879
|
+
products
|
1880
|
+
WHERE
|
1881
|
+
category = 'Guitar'
|
1882
|
+
|
1883
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES ($1)[0m [["version", "20161125151623"]]
|
1884
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
1885
|
+
[1m[36m (0.9ms)[0m [1mROLLBACK[0m
|
1886
|
+
[1m[35m (0.1ms)[0m BEGIN
|
1887
|
+
--------------------------
|
1888
|
+
MigrationTest: test_change
|
1889
|
+
--------------------------
|
1890
|
+
[1m[36m (0.3ms)[0m [1mDROP VIEW guitars[0m
|
1891
|
+
[1m[35m (0.5ms)[0m CREATE VIEW guitars AS
|
1892
|
+
SELECT
|
1893
|
+
*
|
1894
|
+
FROM
|
1895
|
+
products
|
1896
|
+
WHERE
|
1897
|
+
category = 'Guitar'
|
1898
|
+
|
1899
|
+
[1m[36m (0.1ms)[0m [1mROLLBACK[0m
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: views
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.
|
4
|
+
version: 4.0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathías Montossi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|