module Fixturama::Config
@private Configures the gem to exclude conflicts between ids auto-generated by database and hardcoded in fixtures
Constants
- SEQUENCE_BOOST_SCRIPT
@private
Public Instance Methods
start_ids_from(value)
click to toggle source
@param [#to_i] value @return [Boolean]
# File lib/fixturama/config.rb 13 def start_ids_from(value) 14 require "active_record" 15 16 db_name = ActiveRecord::Base.connection_config[:database] 17 sql = format(SEQUENCE_BOOST_SCRIPT, db_name: db_name, min_id: value.to_i) 18 ActiveRecord::Base.connection.execute(sql) 19 20 true 21 rescue LoadError 22 false 23 end