Skip to content

Commit 3d383e0

Browse files
authored
Merge pull request #368 from Dynamoid/support-rails-6
Support Rails 6
2 parents 45e4853 + b807868 commit 3d383e0

34 files changed

+928
-418
lines changed

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@ sudo: required
33
language: ruby
44
rvm:
55
- ruby-2.3.8
6-
- ruby-2.4.5
7-
- ruby-2.5.3
8-
- ruby-2.6.1
9-
- jruby-9.1.17.0
10-
- jruby-9.2.6.0
11-
gemfile:
6+
- ruby-2.4.6
7+
- ruby-2.5.5
8+
- ruby-2.6.3
9+
- jruby-9.2.7.0
1210
gemfile:
1311
- gemfiles/rails_4_2.gemfile
1412
- gemfiles/rails_5_0.gemfile
1513
- gemfiles/rails_5_1.gemfile
1614
- gemfiles/rails_5_2.gemfile
1715

16+
matrix:
17+
include:
18+
- rvm: ruby-2.6.3
19+
gemfile: gemfiles/rails_6_0.gemfile
20+
1821
### BUILD LIFECYCLE STEPS ###
1922

2023
before_install:

Appraisals

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
# frozen_string_literal: true
22

3-
appraise 'rails-4-0' do
4-
gem 'rails', '~> 4.0.0'
5-
gem 'nokogiri', '~> 1.6.8' # can be removed once we drop support for Ruby 2.0.0
6-
end
7-
8-
appraise 'rails-4-1' do
9-
gem 'rails', '~> 4.1.0'
10-
gem 'nokogiri', '~> 1.6.8' # can be removed once we drop support for Ruby 2.0.0
11-
end
12-
133
appraise 'rails-4-2' do
14-
gem 'rails', '~> 4.2.0'
4+
gem 'activemodel', '~> 4.2.0'
155
gem 'nokogiri', '~> 1.6.8' # can be removed once we drop support for Ruby 2.0.0
166
end
177

188
appraise 'rails-5-0' do
19-
gem 'rails', '~> 5.0.0'
9+
gem 'activemodel', '~> 5.0.0'
2010
end
2111

2212
appraise 'rails-5-1' do
23-
gem 'rails', '~> 5.1.0'
13+
gem 'activemodel', '~> 5.1.0'
2414
end
2515

2616
appraise 'rails-5-2' do
27-
gem 'rails', '~> 5.2.0'
17+
gem 'activemodel', '~> 5.2.0'
18+
end
19+
20+
appraise 'rails-6-0' do
21+
gem 'activemodel', '6.0.0.rc1'
2822
end

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
* Improvement: [#359](https://github.com/Dynamoid/dynamoid/pull/359) Add support of `NULL` and `NOT_NULL` operators
1010
* Improvement: [#360](https://github.com/Dynamoid/dynamoid/pull/360) Add `store_attribute_with_nil_value` config option
11+
* Improvement: [#368](https://github.com/Dynamoid/dynamoid/pull/368) Support Rails 6 (RC1)
1112

1213
## Fixes
1314
* Fix: [#357](https://github.com/Dynamoid/dynamoid/pull/357) Fix synchronous table creation issue
1415
* Fix: [#362](https://github.com/Dynamoid/dynamoid/pull/362) Fix issue with selecting Global Secondary Index (@atyndall)
16+
* Fix: [#368](https://github.com/Dynamoid/dynamoid/pull/368) Repair `#previous_changes` method from Dirty API
1517

1618
---
1719

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ used: `attributes_before_type_cast` and `read_attribute_before_type_cast`.
475475

476476
There is `<name>_before_type_cast` method for every field in a model as well.
477477

478+
### Dirty API
479+
480+
Dynamoid supports Dirty API which equvalents to [Rails 5.2 `ActiveModel::Dirty`](https://api.rubyonrails.org/v5.2/classes/ActiveModel/Dirty.html). There is only one limitation - change in place of field is't detected automatically.
481+
478482
## Usage
479483

480484
### Object Creation

gemfiles/rails_4_2.gemfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

5-
source 'https://rubygems.org'
3+
source "https://rubygems.org"
64

7-
gem 'activemodel', '~> 4.2.0'
8-
gem 'nokogiri', '~> 1.6.8'
9-
gem 'pry-byebug', platforms: :ruby
5+
gem "pry-byebug", platforms: :ruby
6+
gem "activemodel", "~> 4.2.0"
7+
gem "nokogiri", "~> 1.6.8"
108

11-
gemspec path: '../'
9+
gemspec path: "../"

gemfiles/rails_5_0.gemfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

5-
source 'https://rubygems.org'
3+
source "https://rubygems.org"
64

7-
gem 'activemodel', '~> 5.0.0'
8-
gem 'pry-byebug', platforms: :ruby
5+
gem "pry-byebug", platforms: :ruby
6+
gem "activemodel", "~> 5.0.0"
97

10-
gemspec path: '../'
8+
gemspec path: "../"

gemfiles/rails_5_1.gemfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

5-
source 'https://rubygems.org'
3+
source "https://rubygems.org"
64

7-
gem 'activemodel', '~> 5.1.0'
8-
gem 'pry-byebug', platforms: :ruby
5+
gem "pry-byebug", platforms: :ruby
6+
gem "activemodel", "~> 5.1.0"
97

10-
gemspec path: '../'
8+
gemspec path: "../"

gemfiles/rails_5_2.gemfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# frozen_string_literal: true
2-
31
# This file was generated by Appraisal
42

5-
source 'https://rubygems.org'
3+
source "https://rubygems.org"
64

7-
gem 'activemodel', '~> 5.2.0'
8-
gem 'pry-byebug', platforms: :ruby
5+
gem "pry-byebug", platforms: :ruby
6+
gem "activemodel", "~> 5.2.0"
97

10-
gemspec path: '../'
8+
gemspec path: "../"

gemfiles/rails_6_0.gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "pry-byebug", platforms: :ruby
6+
gem "activemodel", "6.0.0.rc1"
7+
8+
gemspec path: "../"

lib/dynamoid.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
require 'dynamoid/finders'
3131
require 'dynamoid/identity_map'
3232
require 'dynamoid/config'
33+
require 'dynamoid/loadable'
3334
require 'dynamoid/components'
3435
require 'dynamoid/document'
3536
require 'dynamoid/adapter'

0 commit comments

Comments
 (0)