activerecord-postgresql-extensions 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{activerecord-postgresql-extensions}
8
- s.version = "0.0.8"
8
+ s.version = "0.0.9"
9
9
 
10
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}
11
+ s.authors = [%q{J Smith}]
12
+ s.date = %q{2011-07-14}
13
13
  s.description = %q{A whole bunch of extensions the ActiveRecord PostgreSQL adapter.}
14
14
  s.email = %q{code@zoocasa.com}
15
15
  s.extra_rdoc_files = [
@@ -52,8 +52,8 @@ Gem::Specification.new do |s|
52
52
  "test/test_helper.rb"
53
53
  ]
54
54
  s.homepage = %q{http://github.com/zoocasa/activerecord-postgresql-extensions}
55
- s.require_paths = ["lib"]
56
- s.rubygems_version = %q{1.7.2}
55
+ s.require_paths = [%q{lib}]
56
+ s.rubygems_version = %q{1.8.5}
57
57
  s.summary = %q{A whole bunch of extensions the ActiveRecord PostgreSQL adapter.}
58
58
 
59
59
  if s.respond_to? :specification_version then
@@ -600,6 +600,20 @@ module ActiveRecord
600
600
  end
601
601
  alias_method_chain :change_column_default, :expression
602
602
  end
603
+
604
+ class PostgreSQLColumn < Column
605
+ def simplified_type_with_additional_types(field_type)
606
+ case field_type
607
+ when 'geometry'
608
+ :geometry
609
+ when 'tsvector'
610
+ :tsvector
611
+ else
612
+ simplified_type_without_additional_types(field_type)
613
+ end
614
+ end
615
+ alias_method_chain :simplified_type, :additional_types
616
+ end
603
617
  end
604
618
  end
605
619
 
data/test/adapter_test.rb CHANGED
@@ -42,4 +42,12 @@ class AdapterExtensionTests < Test::Unit::TestCase
42
42
  assert_equal(%{"foo"}, ARBC.quote_view_name(:foo))
43
43
  assert_equal(%{"foo"}, ARBC.quote_tablespace(:foo))
44
44
  end
45
+
46
+ def test_simplified_type
47
+ col = ActiveRecord::ConnectionAdapters::PostgreSQLColumn.new('vector', nil)
48
+ assert_equal(:geometry, col.send(:simplified_type, 'geometry'))
49
+ assert_equal(:tsvector, col.send(:simplified_type, 'tsvector'))
50
+ assert_equal(:integer, col.send(:simplified_type, 'integer'))
51
+ assert_equal(nil, col.send(:simplified_type, 'complete_nonsense'))
52
+ end
45
53
  end
metadata CHANGED
@@ -1,32 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: activerecord-postgresql-extensions
3
- version: !ruby/object:Gem::Version
4
- hash: 15
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 8
10
- version: 0.0.8
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - J Smith
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-07-04 00:00:00 Z
12
+ date: 2011-07-14 00:00:00.000000000Z
19
13
  dependencies: []
20
-
21
14
  description: A whole bunch of extensions the ActiveRecord PostgreSQL adapter.
22
15
  email: code@zoocasa.com
23
16
  executables: []
24
-
25
17
  extensions: []
26
-
27
- extra_rdoc_files:
18
+ extra_rdoc_files:
28
19
  - README.rdoc
29
- files:
20
+ files:
30
21
  - MIT-LICENSE
31
22
  - README.rdoc
32
23
  - Rakefile
@@ -63,36 +54,26 @@ files:
63
54
  - test/test_helper.rb
64
55
  homepage: http://github.com/zoocasa/activerecord-postgresql-extensions
65
56
  licenses: []
66
-
67
57
  post_install_message:
68
58
  rdoc_options: []
69
-
70
- require_paths:
59
+ require_paths:
71
60
  - lib
72
- required_ruby_version: !ruby/object:Gem::Requirement
61
+ required_ruby_version: !ruby/object:Gem::Requirement
73
62
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- hash: 3
78
- segments:
79
- - 0
80
- version: "0"
81
- required_rubygems_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
68
  none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
90
73
  requirements: []
91
-
92
74
  rubyforge_project:
93
- rubygems_version: 1.7.2
75
+ rubygems_version: 1.8.5
94
76
  signing_key:
95
77
  specification_version: 3
96
78
  summary: A whole bunch of extensions the ActiveRecord PostgreSQL adapter.
97
79
  test_files: []
98
-