From 45d33ce6ecc3e61a4abee901b4aac776118860b6 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Tue, 1 Aug 2017 13:29:34 +0200 Subject: [PATCH 01/17] Upgrade to higher minitest version --- simple_enum.gemspec | 8 ++++---- test/array_conversions_test.rb | 2 +- test/class_methods_test.rb | 2 +- test/enum_hash_test.rb | 2 +- test/finders_test.rb | 2 +- test/mongoid_test.rb | 2 +- test/object_backed_test.rb | 2 +- test/poro_test.rb | 2 +- test/prefixes_test.rb | 2 +- test/simple_enum_test.rb | 2 +- test/without_shortcuts_test.rb | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/simple_enum.gemspec b/simple_enum.gemspec index bbfa68e..4eca9f4 100644 --- a/simple_enum.gemspec +++ b/simple_enum.gemspec @@ -8,7 +8,7 @@ Gem::Specification.new do |s| s.summary = "Simple enum-like field support for models." s.description = "Provides enum-like fields for ActiveRecord, ActiveModel and Mongoid models." - s.required_ruby_version = ">= 1.8.7" + s.required_ruby_version = ">= 2.2.2" s.required_rubygems_version = ">= 1.3.6" s.authors = ["Lukas Westermann"] @@ -21,10 +21,10 @@ Gem::Specification.new do |s| s.license = 'MIT' - s.add_dependency "activesupport", '>= 3.0.0' + s.add_dependency "activesupport", '= 5.0.4' s.add_development_dependency 'rake', '>= 0.9.2' - s.add_development_dependency 'minitest', '~> 2.0' + s.add_development_dependency 'minitest' s.add_development_dependency 'activerecord', '>= 3.0.0' - s.add_development_dependency 'mongoid', '~> 2.0' + s.add_development_dependency 'mongoid', '= 6.0.3' end diff --git a/test/array_conversions_test.rb b/test/array_conversions_test.rb index a97ea32..38e574a 100644 --- a/test/array_conversions_test.rb +++ b/test/array_conversions_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class ArrayConversionsTest < MiniTest::Unit::TestCase +class ArrayConversionsTest < Minitest::Test def setup reload_db :genders => true end diff --git a/test/class_methods_test.rb b/test/class_methods_test.rb index efc7f28..a531f38 100644 --- a/test/class_methods_test.rb +++ b/test/class_methods_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class ClassMethodsTest < MiniTest::Unit::TestCase +class ClassMethodsTest < Minitest::Test def setup reload_db end diff --git a/test/enum_hash_test.rb b/test/enum_hash_test.rb index 1bc9f13..ba990cf 100644 --- a/test/enum_hash_test.rb +++ b/test/enum_hash_test.rb @@ -1,7 +1,7 @@ require 'test_helper' require 'simple_enum/enum_hash' -class EnumHashTest < MiniTest::Unit::TestCase +class EnumHashTest < Minitest::Test def test_create_new_enumhash_instance_from_array_of_symbols genders = SimpleEnum::EnumHash.new [:male, :female] diff --git a/test/finders_test.rb b/test/finders_test.rb index 43de073..96335d7 100644 --- a/test/finders_test.rb +++ b/test/finders_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class FindersTest < MiniTest::Unit::TestCase +class FindersTest < Minitest::Test def setup reload_db end diff --git a/test/mongoid_test.rb b/test/mongoid_test.rb index 48f92ce..67abc45 100644 --- a/test/mongoid_test.rb +++ b/test/mongoid_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class MongoidTest < MiniTest::Unit::TestCase +class MongoidTest < Minitest::Test def setup @default_options = SimpleEnum.default_options reload_db diff --git a/test/object_backed_test.rb b/test/object_backed_test.rb index d5ca31a..a65f857 100644 --- a/test/object_backed_test.rb +++ b/test/object_backed_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class ObjectBackedTest < MiniTest::Unit::TestCase +class ObjectBackedTest < Minitest::Test def setup reload_db :genders => true end diff --git a/test/poro_test.rb b/test/poro_test.rb index 36a9b44..cc26b9a 100644 --- a/test/poro_test.rb +++ b/test/poro_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class POROTest < MiniTest::Unit::TestCase +class POROTest < Minitest::Test class MyPORO include SimpleEnum diff --git a/test/prefixes_test.rb b/test/prefixes_test.rb index 99507f1..13efe14 100644 --- a/test/prefixes_test.rb +++ b/test/prefixes_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class PrefixesTest < MiniTest::Unit::TestCase +class PrefixesTest < Minitest::Test def setup reload_db end diff --git a/test/simple_enum_test.rb b/test/simple_enum_test.rb index 6031462..565700c 100644 --- a/test/simple_enum_test.rb +++ b/test/simple_enum_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class SimpleEnumTest < MiniTest::Unit::TestCase +class SimpleEnumTest < Minitest::Test def setup reload_db end diff --git a/test/without_shortcuts_test.rb b/test/without_shortcuts_test.rb index 2ae57cc..6b1b04b 100644 --- a/test/without_shortcuts_test.rb +++ b/test/without_shortcuts_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class WithoutShortcutsTest < MiniTest::Unit::TestCase +class WithoutShortcutsTest < Minitest::Test def setup reload_db From a462226a9843ea38e8eb1066513d5164260b4a7c Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:13:33 +0200 Subject: [PATCH 02/17] Use assert_nil instead of assert_equal --- test/simple_enum_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/simple_enum_test.rb b/test/simple_enum_test.rb index 565700c..f7e91a1 100644 --- a/test/simple_enum_test.rb +++ b/test/simple_enum_test.rb @@ -15,7 +15,7 @@ def test_enum_definitions_only_available_from_class end def test_enum_definitions_local_to_model - assert_equal nil, Computer.enum_definitions[:gender] + assert_nil Computer.enum_definitions[:gender] end def test_getting_the_correct_integer_values_when_setting_to_symbol @@ -57,8 +57,8 @@ def test_setting_value_when_it_is_not_a_string_and_strings_is_true def test_setting_value_to_nil_when_enum_has_nil_as_symbol_and_strings_is_true d = Dummy.new d.nilish = nil - assert_equal(nil, d.nilish) - assert_equal(nil, d.nilish_cd) + assert_nil(d.nilish) + assert_nil(d.nilish_cd) end def test_setting_value_as_key_in_constructor From 56451ff9c22b6730061d66321edf7bb83782a146 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:16:10 +0200 Subject: [PATCH 03/17] Remove useless assignments --- test/class_methods_test.rb | 2 -- test/object_backed_test.rb | 6 +++--- test/simple_enum_test.rb | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/class_methods_test.rb b/test/class_methods_test.rb index a531f38..d0795ce 100644 --- a/test/class_methods_test.rb +++ b/test/class_methods_test.rb @@ -35,8 +35,6 @@ def test_inverted_hash_returns_synonym_by_code end def test_generation_of_value_shortcuts_on_class - g = Dummy.new - assert_equal 0, Dummy.male assert_equal 1, Dummy.female assert_equal 'alpha', Dummy.alpha diff --git a/test/object_backed_test.rb b/test/object_backed_test.rb index a65f857..6ba3918 100644 --- a/test/object_backed_test.rb +++ b/test/object_backed_test.rb @@ -38,9 +38,9 @@ def test_db_backed_objects with_db_obj = anonymous_dummy do as_enum :gender, genders end - - d = with_db_obj.where(:name => 'Bella').first - + + with_db_obj.where(:name => 'Bella').first + assert_respond_to with_db_obj, :female assert_respond_to with_db_obj, :male assert_equal 0, with_db_obj.male diff --git a/test/simple_enum_test.rb b/test/simple_enum_test.rb index f7e91a1..adadcae 100644 --- a/test/simple_enum_test.rb +++ b/test/simple_enum_test.rb @@ -286,7 +286,7 @@ def test_that_setting_to_nil_works_if_whiny_is_true_or_false def test_argument_error_is_raised_when_using_enum_name_eq_column_name begin - invalid_dummy = anonymous_dummy do + anonymous_dummy do as_enum :gender_cd, [:male, :female], :column => "gender_cd" end assert false, "no error raised" From eb7de4c978b90e301cb8fa4d1192f008fde5e261 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:17:47 +0200 Subject: [PATCH 04/17] Initialize mongodb configuration --- test/orm/mongoid.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/orm/mongoid.rb b/test/orm/mongoid.rb index 07d1499..d0de86a 100644 --- a/test/orm/mongoid.rb +++ b/test/orm/mongoid.rb @@ -8,7 +8,8 @@ def orm_version def setup_db # create database connection Mongoid.configure do |config| - config.master = Mongo::Connection.new('localhost').db("simple-enum-test-suite") + config.load_configuration(clients: { default: { database: 'simple_enum_test_suite', + hosts: ['localhost:27017'] } }) config.use_utc = true config.include_root_in_json = true end From be11f826cfec9f0cbe68d9552b0283375f125c5d Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:24:47 +0200 Subject: [PATCH 05/17] Use stored_in to specify collection name --- test/orm/mongoid.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/orm/mongoid.rb b/test/orm/mongoid.rb index d0de86a..519e4c2 100644 --- a/test/orm/mongoid.rb +++ b/test/orm/mongoid.rb @@ -32,15 +32,14 @@ def anonymous_dummy(&block) Class.new do include Mongoid::Document include SimpleEnum::Mongoid - self.collection_name = 'dummies' - instance_eval &block + store_in collection: 'dummies' + instance_eval(&block) end end def extend_computer(current_i18n_name = "Computer", &block) Class.new(Computer) do - self.collection_name = 'computers' - instance_eval &block + instance_eval(&block) instance_eval <<-RUBY def self.model_name; MockName.mock!(#{current_i18n_name.inspect}) end RUBY @@ -49,8 +48,7 @@ def self.model_name; MockName.mock!(#{current_i18n_name.inspect}) end def extend_dummy(current_i18n_name = "Dummy", &block) Class.new(Dummy) do - self.collection_name = 'dummies' - instance_eval &block + instance_eval(&block) instance_eval <<-RUBY def self.model_name; MockName.mock!(#{current_i18n_name.inspect}) end RUBY @@ -66,8 +64,8 @@ def named_dummy(class_name, &block) include Mongoid::Document include SimpleEnum::Mongoid - self.collection_name = 'dummies' - instance_eval &block + store_in collection: 'dummies' + instance_eval(&block) end klass @@ -78,6 +76,7 @@ def named_dummy(class_name, &block) class Dummy include Mongoid::Document include SimpleEnum::Mongoid + store_in collection: 'dummies' as_enum :gender, [:male, :female] as_enum :word, { :alpha => 'alpha', :beta => 'beta', :gamma => 'gamma'} @@ -104,6 +103,7 @@ class Gender class Computer include Mongoid::Document include SimpleEnum::Mongoid + store_in collection: 'computers' field :name, :type => String From 6230aa200960707a95527d59a9f5ef407580aa37 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:26:50 +0200 Subject: [PATCH 06/17] Use reject with positive regex comparison --- test/orm/mongoid.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/orm/mongoid.rb b/test/orm/mongoid.rb index 519e4c2..6679f42 100644 --- a/test/orm/mongoid.rb +++ b/test/orm/mongoid.rb @@ -20,8 +20,8 @@ def setup_db def reload_db(options = {}) # clear collections except system - Mongoid.master.collections.select do |collection| - collection.name !~ /system/ + Mongoid.default_client.collections.reject do |collection| + collection.name =~ /system/ end.each(&:drop) fill_db(options) From ce97efef39bb53a281d0613293af997240e13c14 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:27:23 +0200 Subject: [PATCH 07/17] Add field name as mongo requires it --- test/orm/mongoid.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/orm/mongoid.rb b/test/orm/mongoid.rb index 6679f42..667e99a 100644 --- a/test/orm/mongoid.rb +++ b/test/orm/mongoid.rb @@ -84,6 +84,7 @@ class Dummy as_enum :role, [:admin, :member, :anon], :strings => true as_enum :numeric, [:"100", :"3.14"], :strings => true as_enum :nilish, [:nil], :strings => true + field :name, :type => String before_save :check_typed From 5cb1acd4ac83be321103ad712f538c1bb0fb435c Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:29:21 +0200 Subject: [PATCH 08/17] Remove AR32 --- test/orm/active_record.rb | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/test/orm/active_record.rb b/test/orm/active_record.rb index 2e01887..28eed9e 100644 --- a/test/orm/active_record.rb +++ b/test/orm/active_record.rb @@ -4,22 +4,11 @@ def orm_version ActiveRecord::VERSION::STRING end -def ar32? - ActiveRecord::VERSION::MAJOR >= 3 && ActiveRecord::VERSION::MINOR >= 2 -end - def setup_db # create database connection (in memory db!) ActiveRecord::Base.establish_connection({ :adapter => RUBY_PLATFORM =~ /java/ ? 'jdbcsqlite3' : 'sqlite3', :database => ':memory:'}) - - # Fix visitor, for JRuby - if RUBY_PLATFORM =~ /java/ && ar32? - ActiveRecord::ConnectionAdapters::SQLiteAdapter.send(:define_method, :visitor) do - @visitor ||= Arel::Visitors::SQLite.new(self) - end - end end # Reload database @@ -52,15 +41,15 @@ def reload_db(options = {}) # Models def anonymous_dummy(&block) Class.new(ActiveRecord::Base) do - ar32? ? self.table_name = 'dummies' : set_table_name('dummies') - instance_eval &block + self.table_name = 'dummies' + instance_eval(&block) end end def extend_computer(current_i18n_name = "Computer", &block) Class.new(Computer) do - ar32? ? self.table_name = 'computers' : set_table_name('computers') - instance_eval &block + self.table_name = 'computers' + instance_eval(&block) instance_eval <<-RUBY def self.model_name; MockName.mock!(#{current_i18n_name.inspect}) end RUBY @@ -69,8 +58,8 @@ def self.model_name; MockName.mock!(#{current_i18n_name.inspect}) end def extend_dummy(current_i18n_name = "Dummy", &block) Class.new(Dummy) do - ar32? ? self.table_name = 'dummies' : set_table_name('dummies') - instance_eval &block + self.table_name = 'dummies' + instance_eval(&block) instance_eval <<-RUBY def self.model_name; MockName.mock!(#{current_i18n_name.inspect}) end RUBY @@ -83,8 +72,8 @@ def named_dummy(class_name, &block) rescue NameError klass = Object.const_set(class_name, Class.new(ActiveRecord::Base)) klass.module_eval do - ar32? ? self.table_name = 'dummies' : set_table_name('dummies') - instance_eval &block + self.table_name = 'dummies' + instance_eval(&block) end klass end @@ -109,6 +98,6 @@ class Computer < ActiveRecord::Base # Used to test STI stuff class SpecificDummy < Dummy - ar32? ? self.table_name = 'dummies' : set_table_name('dummies') + self.table_name = 'dummies' end From e2fc621e12c9e7793f3e9776990d85f30cc755df Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 09:30:32 +0200 Subject: [PATCH 09/17] Avoid mongoid _type filter --- test/object_backed_test.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/object_backed_test.rb b/test/object_backed_test.rb index 6ba3918..88d1284 100644 --- a/test/object_backed_test.rb +++ b/test/object_backed_test.rb @@ -18,9 +18,10 @@ def initialize(name) with_object = anonymous_dummy do as_enum :gender, { simple_obj.new('Male') => 0, simple_obj.new('Female') => 1 } end - - d = with_object.where(:name => 'Anna').first - + + d = with_object.where(:name => 'Anna') + d = d.where('_type' => nil) if mongoid? + d = d.first assert_same simple_obj, d.gender.class assert_equal 'Female', d.gender.name assert_same true, d.female? From 4d3426774858c963f2185477a3fc71c56791b463 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 10:13:41 +0200 Subject: [PATCH 10/17] Change get default field value --- test/mongoid_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mongoid_test.rb b/test/mongoid_test.rb index 67abc45..9ba91b0 100644 --- a/test/mongoid_test.rb +++ b/test/mongoid_test.rb @@ -27,7 +27,7 @@ def test_passing_custom_field_options gender_field = klass.new.fields['gender_cd'] refute_nil gender_field - assert_equal 1, gender_field.default + assert_equal 1, gender_field.options[:default] assert_equal klass.fields['verify'].class, gender_field.class assert_equal :female, klass.new.gender end From db426e7ad118a177e9cef22e556629da093ac7aa Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 10:18:43 +0200 Subject: [PATCH 11/17] Update validator --- lib/simple_enum/validation.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/simple_enum/validation.rb b/lib/simple_enum/validation.rb index cad693f..a3c298c 100644 --- a/lib/simple_enum/validation.rb +++ b/lib/simple_enum/validation.rb @@ -1,3 +1,5 @@ +require 'active_model' + module ActiveModel module Validations class AsEnumValidator < ActiveModel::Validator @@ -9,11 +11,8 @@ def initialize(options) super end - def setup(klass) - @klass = klass - end - def validate(record) + @klass ||= record.class attributes.each do |attribute| enum_def = @klass.enum_definitions[attribute] raw_value = record.send(enum_def[:column]) From 8afd57c188a45f2fd874c3eda6342bb5ada82f80 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 10:19:38 +0200 Subject: [PATCH 12/17] Use prepend instead of alias_method_chain --- lib/simple_enum/mongoid.rb | 42 +++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/lib/simple_enum/mongoid.rb b/lib/simple_enum/mongoid.rb index 9ce5d10..90203cc 100644 --- a/lib/simple_enum/mongoid.rb +++ b/lib/simple_enum/mongoid.rb @@ -1,4 +1,5 @@ require 'simple_enum' +require 'mongoid' module SimpleEnum @@ -23,29 +24,36 @@ module SimpleEnum # as_enum :gender, [:female, :male], :field => { :type => Integer } # module Mongoid - extend ActiveSupport::Concern - - included do - # create class level methods - class_attribute :simple_enum_definitions, :instance_writer => false, :instance_reader => false + def self.included(base) + base.extend SimpleEnum::ClassMethods + base.class_eval do + class_attribute :simple_enum_definitions, instance_writer: false, + instance_reader: false + end + base.prepend AsEnumRedefinition end - module ClassMethods - include SimpleEnum::ClassMethods + module AsEnumRedefinition + module ClassMethods + # Wrap method chain to create mongoid field and additional + # column options + def as_enum(enum_cd, values, options = {}) + options = SimpleEnum.default_options.merge(column: "#{enum_cd}_cd").deep_merge(options) - # Wrap method chain to create mongoid field and additional - # column options - def as_enum_with_mongoid(enum_cd, values, options = {}) - options = SimpleEnum.default_options.merge({ :column => "#{enum_cd}_cd" }).deep_merge(options) + # forward custom field options + field_options = options.delete(:field) + field(options[:column], field_options.is_a?(Hash) ? field_options : {}) unless field_options === false - # forward custom field options - field_options = options.delete(:field) - field(options[:column], field_options.is_a?(Hash) ? field_options : {}) unless field_options === false + # call original as_enum method + super(enum_cd, values, options) + end + end - # call original as_enum method - as_enum_without_mongoid(enum_cd, values, options) + def self.prepended(base) + class << base + prepend ClassMethods + end end - alias_method_chain :as_enum, :mongoid end end end From 11d55fbac457509d4637f71e451269fe029bc029 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 10:20:35 +0200 Subject: [PATCH 13/17] Update parameterize syntax --- lib/simple_enum/enum_hash.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/simple_enum/enum_hash.rb b/lib/simple_enum/enum_hash.rb index 8e8c2fd..70285cd 100644 --- a/lib/simple_enum/enum_hash.rb +++ b/lib/simple_enum/enum_hash.rb @@ -10,7 +10,7 @@ class EnumHash < ::ActiveSupport::OrderedHash def self.symbolize(sym) return sym.to_enum_sym if sym.respond_to?(:to_enum_sym) return sym.to_sym if sym.respond_to?(:to_sym) - return sym.name.to_s.parameterize('_').to_sym if sym.respond_to?(:name) + return sym.name.to_s.parameterize(separator: '_').to_sym if sym.respond_to?(:name) sym.to_param.to_sym if sym.present? && sym.respond_to?(:to_param) sym unless sym.blank? end From 54f3d3885952970d8918ae892dc0efa75e47f95b Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 10:27:25 +0200 Subject: [PATCH 14/17] Update gemspec --- simple_enum.gemspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simple_enum.gemspec b/simple_enum.gemspec index 4eca9f4..9c2fddb 100644 --- a/simple_enum.gemspec +++ b/simple_enum.gemspec @@ -21,10 +21,10 @@ Gem::Specification.new do |s| s.license = 'MIT' - s.add_dependency "activesupport", '= 5.0.4' + s.add_dependency "activesupport", '>= 5' s.add_development_dependency 'rake', '>= 0.9.2' s.add_development_dependency 'minitest' - s.add_development_dependency 'activerecord', '>= 3.0.0' - s.add_development_dependency 'mongoid', '= 6.0.3' + s.add_development_dependency 'activerecord', '>= 5' + s.add_development_dependency 'mongoid', '>= 6' end From 01f9d9ea585a4ae52f10da55692d5be8e0530527 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 10:56:19 +0200 Subject: [PATCH 15/17] Update travis yml --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d6f1198..e9b181c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: ruby services: mongodb rvm: - - 1.9.3 - - 2.0.0 - - 2.1.1 - - jruby-19mode + - 2.2.2 + - 2.2.7 + - jruby-9.1.12.0 From 51680878b37aa16e290a26c788618fa0db4c66c8 Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Thu, 3 Aug 2017 11:04:48 +0200 Subject: [PATCH 16/17] Use mongo 2.3 for jruby --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d930891..11c795b 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "http://rubygems.org" gemspec # Fix at 1.9.x, because 1.10 errors on jruby -gem 'mongo', '~> 1.9.0', :platform => :jruby +gem 'mongo', '~> 2.3', :platform => :jruby # some development deps gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby From 068655a6b0c8d4752d4b6b94f2d2516d9808996f Mon Sep 17 00:00:00 2001 From: Ricard Forniol Date: Mon, 2 Dec 2019 16:26:36 +0100 Subject: [PATCH 17/17] Update simple_enum gemspec --- simple_enum.gemspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simple_enum.gemspec b/simple_enum.gemspec index 9c2fddb..ced50bf 100644 --- a/simple_enum.gemspec +++ b/simple_enum.gemspec @@ -21,10 +21,11 @@ Gem::Specification.new do |s| s.license = 'MIT' - s.add_dependency "activesupport", '>= 5' + s.add_dependency "activesupport", '>= 6.0.1' s.add_development_dependency 'rake', '>= 0.9.2' s.add_development_dependency 'minitest' - s.add_development_dependency 'activerecord', '>= 5' + s.add_development_dependency 'activerecord', '>= 6.0.1' s.add_development_dependency 'mongoid', '>= 6' + s.add_development_dependency 'sqlite3' end