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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25680ec45b3bc9a5d63b940f368107cc9bb2a684
4
- data.tar.gz: 0b7a296991e87bb8a597106c891d93d292d75034
3
+ metadata.gz: 3f5a7800d9481e21156049f0c0e99a0eeb000e8f
4
+ data.tar.gz: c6087d37a0b6e7452053e1913f4968075ddb9158
5
5
  SHA512:
6
- metadata.gz: e0c1de49e3ce5211d3e7deaf8109aa5c1c3a7dc9805e2a34c5fd1f06e9d4cb19cf0c227878cc0815593791a97a152872eb134abc7597e2098ffcdd39852c7acc
7
- data.tar.gz: 0272751e441afd367f1561a07a07e433e88609b3ea73cd66be2eedb5063b79751ec74a85692a2f4b8cc69c71d513d9d327d2b5ce5dc6246b56b48a7817af587d
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 < ::Rails::Generators::NamedBase
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.extensions' do
5
- ::ActiveRecord::Migration::CommandRecorder.include(
6
- Views::Extensions::ActiveRecord::CommandRecorder
7
- )
8
- ::ActiveRecord::ConnectionAdapters::AbstractAdapter.include(
9
- Views::Extensions::ActiveRecord::AbstractAdapter
10
- )
11
- ::ActiveRecord::SchemaDumper.prepend(
12
- Views::Extensions::ActiveRecord::SchemaDumper
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
@@ -1,5 +1,5 @@
1
1
  module Views
2
2
 
3
- VERSION = '4.0.0.0'
3
+ VERSION = '4.0.0.1'
4
4
 
5
5
  end
@@ -1,7 +1,10 @@
1
- development:
1
+ default: &default
2
2
  adapter: postgresql
3
+
4
+ development:
5
+ <<: *default
3
6
  database: views_development
4
7
 
5
8
  test:
6
- adapter: postgresql
9
+ <<: *default
7
10
  database: views_test
@@ -1766,3 +1766,134 @@ WHERE
1766
1766
  category = 'Guitar'
1767
1767
 
1768
1768
   (0.1ms) ROLLBACK
1769
+ ActiveRecord::SchemaMigration Load (2.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
1770
+  (0.2ms) BEGIN
1771
+ -----------------------------------
1772
+ GeneratorTest: test_file_generation
1773
+ -----------------------------------
1774
+  (0.2ms) ROLLBACK
1775
+  (0.1ms) BEGIN
1776
+ -------------------
1777
+ TaskTest: test_load
1778
+ -------------------
1779
+  (185.1ms) DROP DATABASE IF EXISTS "views_test"
1780
+  (367.0ms) CREATE DATABASE "views_test" ENCODING = 'utf8'
1781
+ SQL (0.3ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
1782
+  (4.1ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1783
+  (2.0ms) DROP VIEW IF EXISTS guitars
1784
+  (7.4ms) CREATE VIEW guitars AS
1785
+ SELECT
1786
+ *
1787
+ FROM
1788
+ products
1789
+ WHERE
1790
+ category = 'Guitar'
1791
+
1792
+  (19.4ms) CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
1793
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
1794
+  (0.3ms) SELECT version FROM "schema_migrations"
1795
+  (0.4ms) INSERT INTO "schema_migrations" (version) VALUES ('20161125151623')
1796
+  (0.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20161017172847')
1797
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
1798
+  (0.5ms)  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
+ 
1805
+  (0.1ms) BEGIN
1806
+ -------------------
1807
+ TaskTest: test_dump
1808
+ -------------------
1809
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1810
+  (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
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
+  (0.3ms)  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
+ 
1829
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1830
+  (1.3ms) 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
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
+ 
1842
+  (0.3ms) 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
+  (0.1ms) ROLLBACK
1850
+  (0.1ms) BEGIN
1851
+ -----------------------------------
1852
+ MigrationTest: test_create_and_drop
1853
+ -----------------------------------
1854
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1855
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1856
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1857
+ Migrating to CreateGuitarsView (20161125151623)
1858
+  (0.1ms) SAVEPOINT active_record_1
1859
+  (12.3ms) DROP VIEW guitars
1860
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161125151623"]]
1861
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1862
+ Migrating to CreateProducts (20161017172847)
1863
+  (0.1ms) SAVEPOINT active_record_1
1864
+  (0.6ms) DROP TABLE "products"
1865
+ SQL (0.2ms) DELETE FROM "schema_migrations" WHERE "schema_migrations"."version" = $1 [["version", "20161017172847"]]
1866
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1867
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
1868
+ Migrating to CreateProducts (20161017172847)
1869
+  (0.1ms) SAVEPOINT active_record_1
1870
+  (19.7ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying, "category" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)
1871
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161017172847"]]
1872
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1873
+ Migrating to CreateGuitarsView (20161125151623)
1874
+  (0.1ms) SAVEPOINT active_record_1
1875
+  (0.7ms) CREATE VIEW guitars AS
1876
+ SELECT
1877
+ *
1878
+ FROM
1879
+ products
1880
+ WHERE
1881
+ category = 'Guitar'
1882
+
1883
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20161125151623"]]
1884
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1885
+  (0.9ms) ROLLBACK
1886
+  (0.1ms) BEGIN
1887
+ --------------------------
1888
+ MigrationTest: test_change
1889
+ --------------------------
1890
+  (0.3ms) DROP VIEW guitars
1891
+  (0.5ms) CREATE VIEW guitars AS
1892
+ SELECT
1893
+ *
1894
+ FROM
1895
+ products
1896
+ WHERE
1897
+ category = 'Guitar'
1898
+
1899
+  (0.1ms) ROLLBACK
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.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-06 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails