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