Skip to content

Instantly share code, notes, and snippets.

@p
Created December 15, 2015 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p/2d1c26560e63e8850d40 to your computer and use it in GitHub Desktop.
Save p/2d1c26560e63e8850d40 to your computer and use it in GitHub Desktop.
Rails 64 bit primary key fix for sqlite
# force load
ActiveRecord::Type::Integer
class ActiveRecord::Type::Integer
def initialize_with_pk_length_fix(options={})
#options = {limit: 8}.update(options)
# apparently we are receiving limit: nil in options, override hard
options = options.merge(limit: 8)
initialize_without_pk_length_fix(options)
end
alias_method_chain :initialize, :pk_length_fix
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment