activerecord-postgresql-extensions 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.0. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.0.8
         
     | 
| 
         @@ -0,0 +1,68 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Generated by jeweler
         
     | 
| 
      
 2 
     | 
    
         
            +
            # DO NOT EDIT THIS FILE DIRECTLY
         
     | 
| 
      
 3 
     | 
    
         
            +
            # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
         
     | 
| 
      
 4 
     | 
    
         
            +
            # -*- encoding: utf-8 -*-
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Gem::Specification.new do |s|
         
     | 
| 
      
 7 
     | 
    
         
            +
              s.name = %q{activerecord-postgresql-extensions}
         
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = "0.0.8"
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
      
 11 
     | 
    
         
            +
              s.authors = ["J Smith"]
         
     | 
| 
      
 12 
     | 
    
         
            +
              s.date = %q{2011-07-04}
         
     | 
| 
      
 13 
     | 
    
         
            +
              s.description = %q{A whole bunch of extensions the ActiveRecord PostgreSQL adapter.}
         
     | 
| 
      
 14 
     | 
    
         
            +
              s.email = %q{code@zoocasa.com}
         
     | 
| 
      
 15 
     | 
    
         
            +
              s.extra_rdoc_files = [
         
     | 
| 
      
 16 
     | 
    
         
            +
                "README.rdoc"
         
     | 
| 
      
 17 
     | 
    
         
            +
              ]
         
     | 
| 
      
 18 
     | 
    
         
            +
              s.files = [
         
     | 
| 
      
 19 
     | 
    
         
            +
                "MIT-LICENSE",
         
     | 
| 
      
 20 
     | 
    
         
            +
                "README.rdoc",
         
     | 
| 
      
 21 
     | 
    
         
            +
                "Rakefile",
         
     | 
| 
      
 22 
     | 
    
         
            +
                "VERSION",
         
     | 
| 
      
 23 
     | 
    
         
            +
                "activerecord-postgresql-extensions.gemspec",
         
     | 
| 
      
 24 
     | 
    
         
            +
                "lib/activerecord-postgresql-extensions.rb",
         
     | 
| 
      
 25 
     | 
    
         
            +
                "lib/postgresql_extensions/foreign_key_associations.rb",
         
     | 
| 
      
 26 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_adapter_extensions.rb",
         
     | 
| 
      
 27 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_constraints.rb",
         
     | 
| 
      
 28 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_functions.rb",
         
     | 
| 
      
 29 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_geometry.rb",
         
     | 
| 
      
 30 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_indexes.rb",
         
     | 
| 
      
 31 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_languages.rb",
         
     | 
| 
      
 32 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_permissions.rb",
         
     | 
| 
      
 33 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_rules.rb",
         
     | 
| 
      
 34 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_schemas.rb",
         
     | 
| 
      
 35 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_sequences.rb",
         
     | 
| 
      
 36 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_tables.rb",
         
     | 
| 
      
 37 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_triggers.rb",
         
     | 
| 
      
 38 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_types.rb",
         
     | 
| 
      
 39 
     | 
    
         
            +
                "lib/postgresql_extensions/postgresql_views.rb",
         
     | 
| 
      
 40 
     | 
    
         
            +
                "postgresql-extensions.gemspec",
         
     | 
| 
      
 41 
     | 
    
         
            +
                "test/adapter_test.rb",
         
     | 
| 
      
 42 
     | 
    
         
            +
                "test/constraints_test.rb",
         
     | 
| 
      
 43 
     | 
    
         
            +
                "test/functions_test.rb",
         
     | 
| 
      
 44 
     | 
    
         
            +
                "test/geometry_test.rb",
         
     | 
| 
      
 45 
     | 
    
         
            +
                "test/index_test.rb",
         
     | 
| 
      
 46 
     | 
    
         
            +
                "test/languages_test.rb",
         
     | 
| 
      
 47 
     | 
    
         
            +
                "test/permissions_test.rb",
         
     | 
| 
      
 48 
     | 
    
         
            +
                "test/rules_test.rb",
         
     | 
| 
      
 49 
     | 
    
         
            +
                "test/schemas_test.rb",
         
     | 
| 
      
 50 
     | 
    
         
            +
                "test/sequences_test.rb",
         
     | 
| 
      
 51 
     | 
    
         
            +
                "test/tables_test.rb",
         
     | 
| 
      
 52 
     | 
    
         
            +
                "test/test_helper.rb"
         
     | 
| 
      
 53 
     | 
    
         
            +
              ]
         
     | 
| 
      
 54 
     | 
    
         
            +
              s.homepage = %q{http://github.com/zoocasa/activerecord-postgresql-extensions}
         
     | 
| 
      
 55 
     | 
    
         
            +
              s.require_paths = ["lib"]
         
     | 
| 
      
 56 
     | 
    
         
            +
              s.rubygems_version = %q{1.7.2}
         
     | 
| 
      
 57 
     | 
    
         
            +
              s.summary = %q{A whole bunch of extensions the ActiveRecord PostgreSQL adapter.}
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
              if s.respond_to? :specification_version then
         
     | 
| 
      
 60 
     | 
    
         
            +
                s.specification_version = 3
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         
     | 
| 
      
 63 
     | 
    
         
            +
                else
         
     | 
| 
      
 64 
     | 
    
         
            +
                end
         
     | 
| 
      
 65 
     | 
    
         
            +
              else
         
     | 
| 
      
 66 
     | 
    
         
            +
              end
         
     | 
| 
      
 67 
     | 
    
         
            +
            end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
         @@ -82,7 +82,7 @@ module ActiveRecord 
     | 
|
| 
       82 
82 
     | 
    
         | 
| 
       83 
83 
     | 
    
         
             
                    column = self[column_name] || ColumnDefinition.new(base, column_name, :geometry)
         
     | 
| 
       84 
84 
     | 
    
         
             
                    column.default = opts[:default]
         
     | 
| 
       85 
     | 
    
         
            -
                    column.null = opts[: 
     | 
| 
      
 85 
     | 
    
         
            +
                    column.null = opts[:null]
         
     | 
| 
       86 
86 
     | 
    
         | 
| 
       87 
87 
     | 
    
         
             
                    unless @columns.include?(column)
         
     | 
| 
       88 
88 
     | 
    
         
             
                      @columns << column
         
     | 
| 
         @@ -140,7 +140,7 @@ module ActiveRecord 
     | 
|
| 
       140 
140 
     | 
    
         
             
                        base.quote(column_name.to_s),
         
     | 
| 
       141 
141 
     | 
    
         
             
                        opts[:ndims].to_i,
         
     | 
| 
       142 
142 
     | 
    
         
             
                        opts[:srid].to_i,
         
     | 
| 
       143 
     | 
    
         
            -
                        base.quote(opts[:geometry_type].to_s)
         
     | 
| 
      
 143 
     | 
    
         
            +
                        base.quote(opts[:geometry_type].to_s.upcase)
         
     | 
| 
       144 
144 
     | 
    
         
             
                      )
         
     | 
| 
       145 
145 
     | 
    
         
             
                    end
         
     | 
| 
       146 
146 
     | 
    
         | 
    
        data/test/geometry_test.rb
    CHANGED
    
    | 
         @@ -18,7 +18,7 @@ class GeometryTests < Test::Unit::TestCase 
     | 
|
| 
       18 
18 
     | 
    
         
             
              CONSTRAINT "enforce_dims_the_geom" CHECK (ndims("the_geom") = 2)
         
     | 
| 
       19 
19 
     | 
    
         
             
            )},
         
     | 
| 
       20 
20 
     | 
    
         
             
              %{DELETE FROM "geometry_columns" WHERE f_table_catalog = '' AND f_table_schema = 'public' AND f_table_name = 'foo' AND f_geometry_column = 'the_geom'},
         
     | 
| 
       21 
     | 
    
         
            -
              %{INSERT INTO "geometry_columns" VALUES ('', 'public', 'foo', 'the_geom', 2, 4326, ' 
     | 
| 
      
 21 
     | 
    
         
            +
              %{INSERT INTO "geometry_columns" VALUES ('', 'public', 'foo', 'the_geom', 2, 4326, 'GEOMETRY')},
         
     | 
| 
       22 
22 
     | 
    
         
             
              %{CREATE INDEX "foo_the_geom_gist_index" ON "foo" USING "gist"("the_geom")}
         
     | 
| 
       23 
23 
     | 
    
         
             
                ], statements)
         
     | 
| 
       24 
24 
     | 
    
         
             
              end
         
     | 
| 
         @@ -36,7 +36,44 @@ class GeometryTests < Test::Unit::TestCase 
     | 
|
| 
       36 
36 
     | 
    
         
             
              CONSTRAINT "enforce_dims_the_geom" CHECK (ndims("the_geom") = 2)
         
     | 
| 
       37 
37 
     | 
    
         
             
            )},
         
     | 
| 
       38 
38 
     | 
    
         
             
              %{DELETE FROM "geometry_columns" WHERE f_table_catalog = '' AND f_table_schema = 'public' AND f_table_name = 'foo' AND f_geometry_column = 'the_geom'},
         
     | 
| 
       39 
     | 
    
         
            -
              %{INSERT INTO "geometry_columns" VALUES ('', 'public', 'foo', 'the_geom', 2, 4326, ' 
     | 
| 
      
 39 
     | 
    
         
            +
              %{INSERT INTO "geometry_columns" VALUES ('', 'public', 'foo', 'the_geom', 2, 4326, 'GEOMETRY')},
         
     | 
| 
      
 40 
     | 
    
         
            +
              %{CREATE INDEX "foo_the_geom_gist_index" ON "foo" USING "gist"("the_geom")}
         
     | 
| 
      
 41 
     | 
    
         
            +
                ], statements)
         
     | 
| 
      
 42 
     | 
    
         
            +
              end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
              def test_create_geometry_with_not_null
         
     | 
| 
      
 45 
     | 
    
         
            +
                Mig.create_table(:foo) do |t|
         
     | 
| 
      
 46 
     | 
    
         
            +
                  t.geometry :the_geom, :srid => 4326, :null => false
         
     | 
| 
      
 47 
     | 
    
         
            +
                end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                assert_equal([
         
     | 
| 
      
 50 
     | 
    
         
            +
                  %{CREATE TABLE "foo" (
         
     | 
| 
      
 51 
     | 
    
         
            +
              "id" serial primary key,
         
     | 
| 
      
 52 
     | 
    
         
            +
              "the_geom" geometry NOT NULL,
         
     | 
| 
      
 53 
     | 
    
         
            +
              CONSTRAINT "enforce_srid_the_geom" CHECK (srid("the_geom") = (4326)),
         
     | 
| 
      
 54 
     | 
    
         
            +
              CONSTRAINT "enforce_dims_the_geom" CHECK (ndims("the_geom") = 2)
         
     | 
| 
      
 55 
     | 
    
         
            +
            )},
         
     | 
| 
      
 56 
     | 
    
         
            +
              %{DELETE FROM "geometry_columns" WHERE f_table_catalog = '' AND f_table_schema = 'public' AND f_table_name = 'foo' AND f_geometry_column = 'the_geom'},
         
     | 
| 
      
 57 
     | 
    
         
            +
              %{INSERT INTO "geometry_columns" VALUES ('', 'public', 'foo', 'the_geom', 2, 4326, 'GEOMETRY')},
         
     | 
| 
      
 58 
     | 
    
         
            +
              %{CREATE INDEX "foo_the_geom_gist_index" ON "foo" USING "gist"("the_geom")}
         
     | 
| 
      
 59 
     | 
    
         
            +
                ], statements)
         
     | 
| 
      
 60 
     | 
    
         
            +
              end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
              def test_create_geometry_with_null_and_type
         
     | 
| 
      
 63 
     | 
    
         
            +
                Mig.create_table(:foo) do |t|
         
     | 
| 
      
 64 
     | 
    
         
            +
                  t.geometry :the_geom, :srid => 4326, :geometry_type => :polygon
         
     | 
| 
      
 65 
     | 
    
         
            +
                end
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
                assert_equal([
         
     | 
| 
      
 68 
     | 
    
         
            +
                  %{CREATE TABLE "foo" (
         
     | 
| 
      
 69 
     | 
    
         
            +
              "id" serial primary key,
         
     | 
| 
      
 70 
     | 
    
         
            +
              "the_geom" geometry,
         
     | 
| 
      
 71 
     | 
    
         
            +
              CONSTRAINT "enforce_srid_the_geom" CHECK (srid("the_geom") = (4326)),
         
     | 
| 
      
 72 
     | 
    
         
            +
              CONSTRAINT "enforce_dims_the_geom" CHECK (ndims("the_geom") = 2),
         
     | 
| 
      
 73 
     | 
    
         
            +
              CONSTRAINT "enforce_geotype_the_geom" CHECK (geometrytype("the_geom") = 'POLYGON'::text OR "the_geom" IS NULL)
         
     | 
| 
      
 74 
     | 
    
         
            +
            )},
         
     | 
| 
      
 75 
     | 
    
         
            +
              %{DELETE FROM "geometry_columns" WHERE f_table_catalog = '' AND f_table_schema = 'public' AND f_table_name = 'foo' AND f_geometry_column = 'the_geom'},
         
     | 
| 
      
 76 
     | 
    
         
            +
              %{INSERT INTO "geometry_columns" VALUES ('', 'public', 'foo', 'the_geom', 2, 4326, 'POLYGON')},
         
     | 
| 
       40 
77 
     | 
    
         
             
              %{CREATE INDEX "foo_the_geom_gist_index" ON "foo" USING "gist"("the_geom")}
         
     | 
| 
       41 
78 
     | 
    
         
             
                ], statements)
         
     | 
| 
       42 
79 
     | 
    
         
             
              end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: activerecord-postgresql-extensions
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 15
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 0
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 8
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.0.8
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - J Smith
         
     | 
| 
         @@ -15,7 +15,7 @@ autorequire: 
     | 
|
| 
       15 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       16 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            date: 2011- 
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2011-07-04 00:00:00 Z
         
     | 
| 
       19 
19 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
            description: A whole bunch of extensions the ActiveRecord PostgreSQL adapter.
         
     | 
| 
         @@ -31,6 +31,7 @@ files: 
     | 
|
| 
       31 
31 
     | 
    
         
             
            - README.rdoc
         
     | 
| 
       32 
32 
     | 
    
         
             
            - Rakefile
         
     | 
| 
       33 
33 
     | 
    
         
             
            - VERSION
         
     | 
| 
      
 34 
     | 
    
         
            +
            - activerecord-postgresql-extensions.gemspec
         
     | 
| 
       34 
35 
     | 
    
         
             
            - lib/activerecord-postgresql-extensions.rb
         
     | 
| 
       35 
36 
     | 
    
         
             
            - lib/postgresql_extensions/foreign_key_associations.rb
         
     | 
| 
       36 
37 
     | 
    
         
             
            - lib/postgresql_extensions/postgresql_adapter_extensions.rb
         
     |