Class: ActiveRecord::Turntable::Sequencer
- Inherits:
-
Object
- Object
- ActiveRecord::Turntable::Sequencer
show all
- Extended by:
- ActiveSupport::Autoload
- Defined in:
- lib/active_record/turntable/sequencer.rb,
lib/active_record/turntable/sequencer/api.rb,
lib/active_record/turntable/sequencer/mysql.rb,
lib/active_record/turntable/sequencer/barrage.rb,
lib/active_record/turntable/sequencer/katsubushi.rb
Defined Under Namespace
Classes: Api, Barrage, Katsubushi, Mysql
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.class_for(name_or_class) ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/active_record/turntable/sequencer.rb', line 21
def class_for(name_or_class)
case name_or_class
when Sequencer
name_or_class
else
const_get("#{name_or_class.to_s.classify}")
end
end
|
.sequence_name(table_name, primary_key = 'id') ⇒ Object
30
31
32
|
# File 'lib/active_record/turntable/sequencer.rb', line 30
def sequence_name(table_name, primary_key = 'id')
[table_name, primary_key, "seq"].join("_")
end
|
Instance Method Details
#current_sequence_value(sequence_name) ⇒ Object
39
40
41
|
# File 'lib/active_record/turntable/sequencer.rb', line 39
def current_sequence_value(sequence_name)
raise NotImplementedError
end
|
#next_sequence_value(sequence_name) ⇒ Object
35
36
37
|
# File 'lib/active_record/turntable/sequencer.rb', line 35
def next_sequence_value(sequence_name)
raise NotImplementedError
end
|
#release! ⇒ Object
16
17
18
|
# File 'lib/active_record/turntable/sequencer.rb', line 16
def release!
end
|
#sequence_name(table_name, primary_key = 'id') ⇒ Object
12
13
14
|
# File 'lib/active_record/turntable/sequencer.rb', line 12
def sequence_name(table_name, primary_key = 'id')
[table_name, primary_key, "seq"].join("_")
end
|