From c3491943beac0357fb5a48e5f58e59e0669ceddf Mon Sep 17 00:00:00 2001 From: Gena Date: Thu, 14 Dec 2023 20:47:51 +0100 Subject: [PATCH] Fix rails 6.1 tests --- spec/support/rails_template.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/support/rails_template.rb b/spec/support/rails_template.rb index 4329960..49269e5 100644 --- a/spec/support/rails_template.rb +++ b/spec/support/rails_template.rb @@ -32,6 +32,15 @@ def self.ransackable_associations(auth_object=nil) # Virtual attributes inject_into_file "app/models/author.rb", after: "ApplicationRecord\n" do <<-STRING + + def self.ransackable_attributes(auth_object=nil) + if respond_to?(:authorizable_ransackable_attributes) + authorizable_ransackable_attributes + else + ["birthday", "created_at", "last_seen_at", "updated_at"] + end + end + validates_presence_of :name validates_uniqueness_of :last_name