mirror of
https://github.com/awesome-print/awesome_print
synced 2023-03-27 23:22:34 -04:00
Added rails 6.0 and 6.1 tests to travis (#396)
* Added rails 6.0 and 6.1 to travis * Added rails 6 support files * Added data for rais 6.x tests * Rails 6 date helper includes float seconds * Updated actionview test for rails 6.1 Co-authored-by: Bryan Hanks, PMP <bryan@master-developer.com>
This commit is contained in:
parent
c55cf6aba8
commit
60a8498e28
12 changed files with 697 additions and 5 deletions
|
@ -12,6 +12,8 @@ gemfile:
|
|||
- gemfiles/rails_5.0.gemfile
|
||||
- gemfiles/rails_5.1.gemfile
|
||||
- gemfiles/rails_5.2.gemfile
|
||||
- gemfiles/rails_6.0.gemfile
|
||||
- gemfiles/rails_6.1.gemfile
|
||||
- gemfiles/mongoid_5.0.gemfile
|
||||
- gemfiles/mongoid_6.0.gemfile
|
||||
|
||||
|
|
|
@ -19,6 +19,14 @@ appraise 'rails-5.2' do
|
|||
gem 'rails', '>= 5.2.0', '< 5.3'
|
||||
end
|
||||
|
||||
appraise 'rails-6.0' do
|
||||
gem 'rails', '>= 6.0.0', '< 6.1'
|
||||
end
|
||||
|
||||
appraise 'rails-6.1' do
|
||||
gem 'rails', '>= 6.1.0', '< 6.2'
|
||||
end
|
||||
|
||||
appraise 'mongoid-4.0' do
|
||||
gem 'mongoid', '~> 4.0.0'
|
||||
end
|
||||
|
|
7
gemfiles/rails_6.0.gemfile
Normal file
7
gemfiles/rails_6.0.gemfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
# This file was generated by Appraisal
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "rails", ">= 6.0.0", "< 6.1"
|
||||
|
||||
gemspec path: "../"
|
7
gemfiles/rails_6.1.gemfile
Normal file
7
gemfiles/rails_6.1.gemfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
# This file was generated by Appraisal
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "rails", ">= 6.1.0", "< 6.2"
|
||||
|
||||
gemspec path: "../"
|
|
@ -1,9 +1,12 @@
|
|||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'AwesomePrint ActionView extensions', skip: -> { !ExtVerifier.has_rails? }.call do
|
||||
|
||||
before do
|
||||
@view = ActionView::Base.new
|
||||
@view = if rails_6_1?
|
||||
ActionView::Base.new(ActionView::LookupContext.new([]), {}, {})
|
||||
else
|
||||
ActionView::Base.new
|
||||
end
|
||||
end
|
||||
|
||||
it "uses HTML and adds 'debug_dump' class to plain <pre> tag" do
|
||||
|
|
|
@ -120,7 +120,11 @@ EOS
|
|||
out = @ap.awesome(@diana)
|
||||
|
||||
raw_object_string =
|
||||
if activerecord_5_2?
|
||||
if activerecord_6_1?
|
||||
ActiveRecordData.raw_6_1_diana
|
||||
elsif activerecord_6_0?
|
||||
ActiveRecordData.raw_6_0_diana
|
||||
elsif activerecord_5_2?
|
||||
ActiveRecordData.raw_5_2_diana
|
||||
elsif activerecord_5_1?
|
||||
ActiveRecordData.raw_5_1_diana
|
||||
|
@ -143,7 +147,11 @@ EOS
|
|||
out = @ap.awesome([@diana, @laura])
|
||||
|
||||
raw_object_string =
|
||||
if activerecord_5_2?
|
||||
if activerecord_6_1?
|
||||
ActiveRecordData.raw_6_1_multi
|
||||
elsif activerecord_6_0?
|
||||
ActiveRecordData.raw_6_0_multi
|
||||
elsif activerecord_5_2?
|
||||
ActiveRecordData.raw_5_2_multi
|
||||
elsif activerecord_5_1?
|
||||
ActiveRecordData.raw_5_1_multi
|
||||
|
|
|
@ -8,7 +8,11 @@ RSpec.describe 'AwesomePrint::ActiveSupport', skip: -> { !ExtVerifier.has_rails?
|
|||
it 'should format ActiveSupport::TimeWithZone as regular Time' do
|
||||
Time.zone = 'Eastern Time (US & Canada)'
|
||||
time = Time.utc(2007, 2, 10, 20, 30, 45).in_time_zone
|
||||
expect(@ap.send(:awesome, time)).to eq("\e[0;32mSat, 10 Feb 2007 15:30:45 EST -05:00\e[0m")
|
||||
if activerecord_6_1?
|
||||
expect(@ap.send(:awesome, time)).to eq("\e[0;32mSat, 10 Feb 2007 15:30:45.000000000 EST -05:00\e[0m")
|
||||
else
|
||||
expect(@ap.send(:awesome, time)).to eq("\e[0;32mSat, 10 Feb 2007 15:30:45 EST -05:00\e[0m")
|
||||
end
|
||||
end
|
||||
|
||||
it 'should format HashWithIndifferentAccess as regular Hash' do
|
||||
|
|
104
spec/support/active_record_data/6_0_diana.txt
Normal file
104
spec/support/active_record_data/6_0_diana.txt
Normal file
|
@ -0,0 +1,104 @@
|
|||
#<User:placeholder_id
|
||||
@_start_transaction_state = nil,
|
||||
@association_cache = {},
|
||||
@destroyed = false,
|
||||
@marked_for_destruction = false,
|
||||
@new_record = true,
|
||||
@primary_key = "id",
|
||||
@readonly = false,
|
||||
@transaction_state = nil,
|
||||
attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
|
||||
@attributes = {
|
||||
"admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = false
|
||||
>,
|
||||
"created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "1992-10-10 12:30:00"
|
||||
>,
|
||||
"id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "id",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
"name" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "Diana"
|
||||
>,
|
||||
"rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = 1
|
||||
>
|
||||
}
|
||||
>,
|
||||
attr_accessor :destroyed_by_association = nil
|
||||
>
|
210
spec/support/active_record_data/6_0_multi.txt
Normal file
210
spec/support/active_record_data/6_0_multi.txt
Normal file
|
@ -0,0 +1,210 @@
|
|||
[
|
||||
[0] #<User:placeholder_id
|
||||
@_start_transaction_state = nil,
|
||||
@association_cache = {},
|
||||
@destroyed = false,
|
||||
@marked_for_destruction = false,
|
||||
@new_record = true,
|
||||
@primary_key = "id",
|
||||
@readonly = false,
|
||||
@transaction_state = nil,
|
||||
attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
|
||||
@attributes = {
|
||||
"admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = false
|
||||
>,
|
||||
"created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "1992-10-10 12:30:00"
|
||||
>,
|
||||
"id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "id",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
"name" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "Diana"
|
||||
>,
|
||||
"rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = 1
|
||||
>
|
||||
}
|
||||
>,
|
||||
attr_accessor :destroyed_by_association = nil
|
||||
>,
|
||||
[1] #<User:placeholder_id
|
||||
@_start_transaction_state = nil,
|
||||
@association_cache = {},
|
||||
@destroyed = false,
|
||||
@marked_for_destruction = false,
|
||||
@new_record = true,
|
||||
@primary_key = "id",
|
||||
@readonly = false,
|
||||
@transaction_state = nil,
|
||||
attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
|
||||
@attributes = {
|
||||
"admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = true
|
||||
>,
|
||||
"created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "2003-05-26 14:15:00"
|
||||
>,
|
||||
"id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "id",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
"name" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "Laura"
|
||||
>,
|
||||
"rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = 2
|
||||
>
|
||||
}
|
||||
>,
|
||||
attr_accessor :destroyed_by_association = nil
|
||||
>
|
||||
]
|
109
spec/support/active_record_data/6_1_diana.txt
Normal file
109
spec/support/active_record_data/6_1_diana.txt
Normal file
|
@ -0,0 +1,109 @@
|
|||
#<User:placeholder_id
|
||||
@_start_transaction_state = nil,
|
||||
@association_cache = {},
|
||||
@destroyed = false,
|
||||
@marked_for_destruction = false,
|
||||
@new_record = true,
|
||||
@previously_new_record = false,
|
||||
@primary_key = "id",
|
||||
@readonly = false,
|
||||
@strict_loading = false,
|
||||
attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
|
||||
@attributes = {
|
||||
"admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = false
|
||||
>,
|
||||
"created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "1992-10-10 12:30:00"
|
||||
>,
|
||||
"id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "id",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
"name" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
@false = "f",
|
||||
@true = "t",
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
@false = "f",
|
||||
@true = "t",
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "Diana"
|
||||
>,
|
||||
"rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = 1
|
||||
>
|
||||
}
|
||||
>,
|
||||
attr_accessor :destroyed_by_association = nil
|
||||
>
|
220
spec/support/active_record_data/6_1_multi.txt
Normal file
220
spec/support/active_record_data/6_1_multi.txt
Normal file
|
@ -0,0 +1,220 @@
|
|||
[
|
||||
[0] #<User:placeholder_id
|
||||
@_start_transaction_state = nil,
|
||||
@association_cache = {},
|
||||
@destroyed = false,
|
||||
@marked_for_destruction = false,
|
||||
@new_record = true,
|
||||
@previously_new_record = false,
|
||||
@primary_key = "id",
|
||||
@readonly = false,
|
||||
@strict_loading = false,
|
||||
attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
|
||||
@attributes = {
|
||||
"admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = false
|
||||
>,
|
||||
"created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "1992-10-10 12:30:00"
|
||||
>,
|
||||
"id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "id",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
"name" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
@false = "f",
|
||||
@true = "t",
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
@false = "f",
|
||||
@true = "t",
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "Diana"
|
||||
>,
|
||||
"rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = 1
|
||||
>
|
||||
}
|
||||
>,
|
||||
attr_accessor :destroyed_by_association = nil
|
||||
>,
|
||||
[1] #<User:placeholder_id
|
||||
@_start_transaction_state = nil,
|
||||
@association_cache = {},
|
||||
@destroyed = false,
|
||||
@marked_for_destruction = false,
|
||||
@new_record = true,
|
||||
@previously_new_record = false,
|
||||
@primary_key = "id",
|
||||
@readonly = false,
|
||||
@strict_loading = false,
|
||||
attr_accessor :attributes = #<ActiveModel::AttributeSet:placeholder_id
|
||||
@attributes = {
|
||||
"admin" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "admin",
|
||||
attr_reader :type = #<ActiveModel::Type::Boolean:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = true
|
||||
>,
|
||||
"created_at" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "created_at",
|
||||
attr_reader :type = #<ActiveRecord::Type::DateTime:placeholder_id
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "2003-05-26 14:15:00"
|
||||
>,
|
||||
"id" => #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "id",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
"name" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
@false = "f",
|
||||
@true = "t",
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "name",
|
||||
attr_reader :type = #<ActiveModel::Type::String:placeholder_id
|
||||
@false = "f",
|
||||
@true = "t",
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = "Laura"
|
||||
>,
|
||||
"rank" => #<ActiveModel::Attribute::FromUser:placeholder_id
|
||||
@original_attribute = #<ActiveModel::Attribute::FromDatabase:placeholder_id
|
||||
@original_attribute = nil,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = nil
|
||||
>,
|
||||
attr_reader :name = "rank",
|
||||
attr_reader :type = #<ActiveRecord::ConnectionAdapters::SQLite3Adapter::SQLite3Integer:placeholder_id
|
||||
@range = -9223372036854775808...9223372036854775808,
|
||||
attr_reader :limit = nil,
|
||||
attr_reader :precision = nil,
|
||||
attr_reader :scale = nil
|
||||
>,
|
||||
attr_reader :value_before_type_cast = 2
|
||||
>
|
||||
}
|
||||
>,
|
||||
attr_accessor :destroyed_by_association = nil
|
||||
>
|
||||
]
|
|
@ -3,6 +3,16 @@ module RailsVersions
|
|||
Gem::Version.new(Rails::VERSION::STRING)
|
||||
end
|
||||
|
||||
def rails_6_1?
|
||||
Gem::Requirement.new('~> 6.1.0').satisfied_by?(rails_version)
|
||||
end
|
||||
alias_method :activerecord_6_1?, :rails_6_1?
|
||||
|
||||
def rails_6_0?
|
||||
Gem::Requirement.new('~> 6.0.0').satisfied_by?(rails_version)
|
||||
end
|
||||
alias_method :activerecord_6_0?, :rails_6_0?
|
||||
|
||||
def rails_5_2?
|
||||
Gem::Requirement.new('~> 5.2.0').satisfied_by?(rails_version)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue