From 017cba372dfafee700161faf01caa88a29c97ae6 Mon Sep 17 00:00:00 2001 From: edward sharp Date: Tue, 12 Jul 2016 22:47:50 -0400 Subject: [PATCH] fix for rails 5 https://github.com/jashmenn/activeuuid/issues/80 --- lib/activeuuid/patches.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/activeuuid/patches.rb b/lib/activeuuid/patches.rb index dfb7903..33b41e7 100644 --- a/lib/activeuuid/patches.rb +++ b/lib/activeuuid/patches.rb @@ -1,7 +1,7 @@ require 'active_record' require 'active_support/concern' -if ActiveRecord::VERSION::MAJOR == 4 and ActiveRecord::VERSION::MINOR == 2 +if ActiveRecord::VERSION::MAJOR >= 4 module ActiveRecord module Type class UUID < Binary # :nodoc: @@ -181,7 +181,7 @@ def self.apply! ActiveRecord::ConnectionAdapters::Table.send :include, Migrations if defined? ActiveRecord::ConnectionAdapters::Table ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Migrations if defined? ActiveRecord::ConnectionAdapters::TableDefinition - if ActiveRecord::VERSION::MAJOR == 4 and ActiveRecord::VERSION::MINOR == 2 + if ActiveRecord::VERSION::MAJOR >= 4 ActiveRecord::ConnectionAdapters::Mysql2Adapter.send :include, AbstractAdapter if defined? ActiveRecord::ConnectionAdapters::Mysql2Adapter ActiveRecord::ConnectionAdapters::SQLite3Adapter.send :include, AbstractAdapter if defined? ActiveRecord::ConnectionAdapters::SQLite3Adapter else @@ -196,4 +196,4 @@ def self.apply! ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send :include, PostgreSQLQuoting if defined? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter end end -end +end \ No newline at end of file