Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 24 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
language: ruby
sudo: false
env:
- "RAILS_VERSION=4.2.6"
- "RAILS_VERSION=5.0.0"
- "RAILS_VERSION=master"
- "RAILS_VERSION=4.2.11"
- "RAILS_VERSION=5.0.7.2"
- "RAILS_VERSION=5.1.7"
- "RAILS_VERSION=5.2.3"
- "RAILS_VERSION=6.0.0"
- "RAILS_VERSION=6.1.0"
rvm:
- 2.1
- 2.2.4
- 2.3.0
- 2.3.8
- 2.4.7
- 2.5.6
- 2.6.4
matrix:
exclude:
- rvm: 2.0
env: "RAILS_VERSION=5.0.0"
- rvm: 2.1
env: "RAILS_VERSION=5.0.0"
allow_failures:
- env: "RAILS_VERSION=master"
- env: "RAILS_VERSION=6.0.0.beta1"
exclude:
- rvm: 2.6.4
env: "RAILS_VERSION=4.2.11"
- rvm: 2.3.8
env: "RAILS_VERSION=6.0.0"
- rvm: 2.4.7
env: "RAILS_VERSION=6.0.0"
- rvm: 2.3.8
env: "RAILS_VERSION=6.1.0"
- rvm: 2.4.7
env: "RAILS_VERSION=6.1.0"
before_install:
- gem install bundler --version 1.17.3
4 changes: 2 additions & 2 deletions lib/jsonapi/resource_controller_metal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ class ResourceControllerMetal < ActionController::Metal
ActionController::Rendering,
ActionController::Renderers::All,
ActionController::StrongParameters,
ActionController::ForceSSL,
Gem::Requirement.new('< 6.1').satisfied_by?(ActionPack.gem_version) ? ActionController::ForceSSL : nil,
ActionController::Instrumentation,
JSONAPI::ActsAsResourceController
].freeze
].compact.freeze

MODULES.each do |mod|
include mod
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ class Post < ActiveRecord::Base
belongs_to :writer, class_name: 'Person', foreign_key: 'author_id'
has_many :comments
has_and_belongs_to_many :tags, join_table: :posts_tags
has_many :special_post_tags, source: :tag
has_many :special_post_tags
has_many :special_tags, through: :special_post_tags, source: :tag
belongs_to :section
has_one :parent_post, class_name: 'Post', foreign_key: 'parent_post_id'
Expand Down
4 changes: 2 additions & 2 deletions test/unit/resource/resource_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PostWithBadAfterSave < ActiveRecord::Base
after_save :do_some_after_save_stuff

def do_some_after_save_stuff
errors[:base] << 'Boom! Error added in after_save callback.'
errors.add(:base, 'Boom! Error added in after_save callback.')
raise ActiveRecord::RecordInvalid.new(self)
end
end
Expand All @@ -23,7 +23,7 @@ class PostWithCustomValidationContext < ActiveRecord::Base
validate :api_specific_check, on: :json_api_create

def api_specific_check
errors[:base] << 'Record is invalid'
errors.add(:base, 'Record is invalid')
end
end

Expand Down