jqr-postgres_sequence_support 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.0.5. Remove duplicate and correct quoting by Jonathan Tron [JonathanTron].
2
+
1
3
  v0.0.4. Cleanup of gem release and proper Rails plugin support.
2
4
 
3
5
  v0.0.3. Initial gem release.
@@ -22,19 +22,15 @@ module ActiveRecord
22
22
  class PostgreSQLAdapter
23
23
  # Returns the next value in sequence.
24
24
  def next_in_sequence(sequence)
25
- select_value("SELECT nextval(#{quote_table_name(sequence)})").to_i
25
+ select_value("SELECT nextval('#{PGconn.quote_ident(sequence)}')").to_i
26
26
  end
27
27
 
28
28
  def current_in_sequence(sequence)
29
- select_value("SELECT currval(#{quote_table_name(sequence)})").to_i
30
- end
31
-
32
- def current_in_sequence(sequence)
33
- select_value("SELECT lastval(#{quote_table_name(sequence)})").to_i
29
+ select_value("SELECT currval('#{PGconn.quote_ident(sequence)}')").to_i
34
30
  end
35
31
 
36
32
  def set_sequence(sequence, value, value_used = true)
37
- select_value("SELECT setval(#{quote_table_name(sequence)}, #{quote(value)}, #{quote(value_used)})")
33
+ select_value("SELECT setval('#{PGconn.quote_ident(sequence)}', #{quote(value)}, #{quote(value_used)})")
38
34
  end
39
35
 
40
36
  def create_sequence(sequence, start = nil)
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{postgres_sequence_support}
5
- s.version = "0.0.4"
5
+ s.version = "0.0.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Elijah Miller"]
9
- s.date = %q{2009-01-15}
9
+ s.date = %q{2009-01-22}
10
10
  s.description = %q{Easy manipulation of PostgreSQL sequences from ActiveRecord.}
11
11
  s.email = %q{elijah.miller@gmail.com}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "lib/postgres_sequence_support.rb", "LICENSE", "README.rdoc"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jqr-postgres_sequence_support
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elijah Miller
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-15 00:00:00 -08:00
12
+ date: 2009-01-22 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency