Navigation Menu

Skip to content

Commit

Permalink
Deprecation for ruby 2.4 removed
Browse files Browse the repository at this point in the history
Secondary credit: camelmasa <camelmasa@gmail.com>
  • Loading branch information
dima4p authored and mcmire committed Oct 3, 2017
1 parent b310986 commit 03a1d21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Expand Up @@ -269,7 +269,7 @@ def validate_inclusion_of(attr)
# @private
class ValidateInclusionOfMatcher < ValidationMatcher
ARBITRARY_OUTSIDE_STRING = 'shoulda-matchers test string'
ARBITRARY_OUTSIDE_FIXNUM = 123456789
ARBITRARY_OUTSIDE_INTEGER = 123456789
ARBITRARY_OUTSIDE_DECIMAL = BigDecimal.new('0.123456789')
ARBITRARY_OUTSIDE_DATE = Date.jd(9999999)
ARBITRARY_OUTSIDE_DATETIME = DateTime.jd(9999999)
Expand Down Expand Up @@ -483,8 +483,8 @@ def outside_values
case attribute_type
when :boolean
boolean_outside_values
when :fixnum
[ARBITRARY_OUTSIDE_FIXNUM]
when :integer
[ARBITRARY_OUTSIDE_INTEGER]
when :decimal
[ARBITRARY_OUTSIDE_DECIMAL]
when :date
Expand Down Expand Up @@ -538,7 +538,7 @@ def attribute_column

def column_type_to_attribute_type(type)
case type
when :integer, :float then :fixnum
when :float then :integer
when :timestamp then :datetime
else type
end
Expand All @@ -548,7 +548,7 @@ def value_to_attribute_type(value)
case value
when true, false then :boolean
when BigDecimal then :decimal
when Integer then :fixnum
when Integer then :integer
when Date then :date
when DateTime then :datetime
when Time then :time
Expand Down
Expand Up @@ -25,7 +25,7 @@ def self.testing_values_of_option(option_name, &block)
it_behaves_like 'it supports in_array',
possible_values: (1..5).to_a,
zero: 0,
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_FIXNUM
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_INTEGER

it_behaves_like 'it supports in_range',
possible_values: 1..5,
Expand Down Expand Up @@ -82,7 +82,7 @@ def expect_to_match_on_values(builder, values, &block)
it_behaves_like 'it supports in_array',
possible_values: [1.0, 2.0, 3.0, 4.0, 5.0],
zero: 0.0,
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_FIXNUM
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_INTEGER

it_behaves_like 'it supports in_range',
possible_values: 1.0..5.0,
Expand Down

0 comments on commit 03a1d21

Please sign in to comment.