Sha256: 4a65956bbcf399fbc70ea29216ac52897f6626458640ca7fa5b9853a5d9d34fd

Contents?: true

Size: 753 Bytes

Versions: 6

Compression:

Stored size: 753 Bytes

Contents

module ActiveRecord::Turntable::ActiveRecordExt
  module Sequencer
    def default_sequence_name(table_name, pk = nil)
      if ActiveRecord::Turntable::Sequencer.has_sequencer?(table_name)
        ActiveRecord::Turntable::Sequencer.sequence_name(table_name, pk)
      else
        super
      end
    end

    def prefetch_primary_key?(table_name = nil)
      ActiveRecord::Turntable::Sequencer.has_sequencer?(table_name)
    end

    def next_sequence_value(sequence_name)
      ActiveRecord::Turntable::Sequencer.sequences[sequence_name].next_sequence_value(sequence_name)
    end

    def current_sequence_value(sequence_name)
      ActiveRecord::Turntable::Sequencer.sequences[sequence_name].current_sequence_value(sequence_name)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerecord-turntable-3.1.0 lib/active_record/turntable/active_record_ext/sequencer.rb
activerecord-turntable-3.0.1 lib/active_record/turntable/active_record_ext/sequencer.rb
activerecord-turntable-3.0.0 lib/active_record/turntable/active_record_ext/sequencer.rb
activerecord-turntable-3.0.0.alpha3 lib/active_record/turntable/active_record_ext/sequencer.rb
activerecord-turntable-3.0.0.alpha2 lib/active_record/turntable/active_record_ext/sequencer.rb
activerecord-turntable-3.0.0.alpha1 lib/active_record/turntable/active_record_ext/sequencer.rb