Skip to content

Commit a9a4637

Browse files
authored
Merge pull request #85 from PlayerData/ruby-3
2 parents 849f45a + fda505b commit a9a4637

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@ jobs:
1818
strategy:
1919
matrix:
2020
ruby: [2.2, 2.3, 2.4, 2.5, 2.6, 2.7]
21-
activemodel: [3.2, 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0]
21+
activemodel: [3.2, 4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1]
22+
include:
23+
- ruby: 3.0
24+
activemodel: 6.0
25+
- ruby: 3.0
26+
activemodel: 6.1
2227
exclude:
2328
- ruby: 2.2
2429
activemodel: 6.0
2530
- ruby: 2.3
2631
activemodel: 6.0
2732
- ruby: 2.4
2833
activemodel: 6.0
34+
- ruby: 2.2
35+
activemodel: 6.1
36+
- ruby: 2.3
37+
activemodel: 6.1
38+
- ruby: 2.4
39+
activemodel: 6.1
2940
fail-fast: true
3041
env:
3142
ACTIVE_MODEL_VERSION: ${{ matrix.activemodel }}

Gemfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@ active_model_opts =
1010
end
1111

1212
gem 'activemodel', active_model_opts
13-
14-
platforms :rbx do
15-
gem 'rubysl', '~> 2.0'
16-
end

lib/active_model/validations/date_validator.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ def validate_each(record, attr_name, value)
5959
end
6060

6161
if value_before_type_cast.present? && value.nil?
62-
record.errors.add(attr_name, :not_a_date, options)
62+
record.errors.add(attr_name, :not_a_date, **options)
6363
return
6464
end
6565

6666
return if (value.nil? && options[:allow_nil]) || (value.blank? && options[:allow_blank])
6767

6868
unless value
69-
record.errors.add(attr_name, :not_a_date, options)
69+
record.errors.add(attr_name, :not_a_date, **options)
7070
return
7171
end
7272

7373
unless is_time?(value)
74-
record.errors.add(attr_name, :not_a_date, options)
74+
record.errors.add(attr_name, :not_a_date, **options)
7575
return
7676
end
7777

@@ -94,7 +94,7 @@ def validate_each(record, attr_name, value)
9494
end
9595

9696
unless is_time?(option_value) && value.to_i.send(CHECKS[option], option_value.to_i)
97-
record.errors.add(attr_name, :"date_#{option}", options.merge(
97+
record.errors.add(attr_name, :"date_#{option}", **options.merge(
9898
value: original_value,
9999
date: (I18n.localize(original_option_value) rescue original_option_value)
100100
))

0 commit comments

Comments
 (0)