Skip to content

Commit

Permalink
Fix rails 6.1 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
workgena committed Dec 14, 2023
1 parent 18a8bb2 commit c349194
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/support/rails_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c349194

Please sign in to comment.