diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 008398d..ac7e4a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,12 +6,13 @@ jobs: strategy: matrix: mongodb: [4.4] - ruby: [2.7, "3.0", 3.1, 3.2] + ruby: [2.7, "3.0", 3.1, 3.2, 3.3] gemfile: - carrierwave-2.1 - carrierwave-2.2 - mongoid-7 - mongoid-8 + - mongoid-9 include: - { mongodb: "4.4", ruby: "2.6", gemfile: "carrierwave-0.10" } - { mongodb: "4.4", ruby: "2.6", gemfile: "carrierwave-0.11" } @@ -31,15 +32,15 @@ jobs: uses: supercharge/mongodb-github-action@1.3.0 with: mongodb-version: ${{ matrix.mongodb }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mimemagic-0.4.3/gem_make.out + - run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/${{ matrix.ruby }}/extensions/x86_64-linux/${{ matrix.ruby }}/mimemagic-0.4.3/gem_make.out if: ${{ failure() }} - - run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/3.0.0/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile + - run: cat /home/runner/work/carrierwave-mongoid/carrierwave-mongoid/vendor/bundle/ruby/${{ matrix.ruby }}/gems/mimemagic-0.4.3/ext/mimemagic/Rakefile if: ${{ failure() }} - name: Run tests run: bundle exec rake diff --git a/carrierwave-mongoid.gemspec b/carrierwave-mongoid.gemspec index 998abf2..e761198 100644 --- a/carrierwave-mongoid.gemspec +++ b/carrierwave-mongoid.gemspec @@ -21,11 +21,11 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.add_dependency "carrierwave", [">= 0.8", "< 3"] - s.add_dependency "mongoid", [">= 3.0", "< 9.0"] + s.add_dependency "mongoid", [">= 3.0", "< 10.0"] s.add_dependency "mongoid-grid_fs", [">= 1.3", "< 3.0"] s.add_dependency "mime-types", "< 3" if RUBY_VERSION < "2.0" # mime-types 3+ doesn't support ruby 1.9 s.add_development_dependency "rspec", "~> 3.4" s.add_development_dependency "rake", ">= 12.3.3" - s.add_development_dependency "mini_magick" + s.add_development_dependency "mini_magick", "< 5" s.add_development_dependency "pry" end diff --git a/gemfiles/mongoid-9.gemfile b/gemfiles/mongoid-9.gemfile new file mode 100644 index 0000000..b7549b1 --- /dev/null +++ b/gemfiles/mongoid-9.gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "mongoid", "~> 9.0" +gem "carrierwave", "~> 2.2" + +gemspec path: "../" diff --git a/spec/mongoid_spec.rb b/spec/mongoid_spec.rb index 4de3289..34a5d37 100644 --- a/spec/mongoid_spec.rb +++ b/spec/mongoid_spec.rb @@ -623,11 +623,13 @@ def filename it "attaches a new file to an existing document that had no file at first" do doc = @class.new - doc.mongo_locations.build + new_file = doc.mongo_locations.build + expect(new_file.save).to be_truthy expect(doc.save).to be_truthy doc.reload - doc.mongo_locations.first.image = stub_file('test.jpeg') + new_file.image = stub_file('test.jpeg') + expect(new_file.save).to be_truthy expect(doc.save).to be_truthy doc.reload