Skip to content

Commit 07fbf94

Browse files
committed
Compatibility with old/new ransack
1 parent 765cf2e commit 07fbf94

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

spec/support/rails_template.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@
77
ransackable_block = <<-STRING
88
99
def self.ransackable_attributes(auth_object=nil)
10-
authorizable_ransackable_attributes
10+
if respond_to?(:authorizable_ransackable_attributes)
11+
authorizable_ransackable_attributes
12+
else
13+
super
14+
end
1115
end
1216
1317
def self.ransackable_associations(auth_object=nil)
14-
authorizable_ransackable_associations
18+
if respond_to?(:authorizable_ransackable_associations)
19+
authorizable_ransackable_associations
20+
else
21+
super
22+
end
1523
end
1624
STRING
1725

0 commit comments

Comments
 (0)