Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/postgres_sequence_support.rb
Class Method Summary collapse
- .current_id ⇒ Object
- .id_sequence ⇒ Object
- .last_id ⇒ Object
-
.next_id ⇒ Object
Returns the next id on the table’s id sequence.
Class Method Details
.current_id ⇒ Object
12 13 14 |
# File 'lib/postgres_sequence_support.rb', line 12 def self.current_id connection.current_in_sequence(id_sequence) end |
.id_sequence ⇒ Object
3 4 5 |
# File 'lib/postgres_sequence_support.rb', line 3 def self.id_sequence connection.default_sequence_name end |
.last_id ⇒ Object
16 17 18 |
# File 'lib/postgres_sequence_support.rb', line 16 def self.last_id connection.current_in_sequence(id_sequence) end |
.next_id ⇒ Object
Returns the next id on the table’s id sequence.
8 9 10 |
# File 'lib/postgres_sequence_support.rb', line 8 def self.next_id connection.next_in_sequence(id_sequence) end |