Created
June 12, 2022 08:54
-
-
Save tk0miya/9e52a84c64ca1604aeed64fbe14489f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# ActiveYaml の association を Ransack で検索可能にする | |
module ActiveHash | |
module Ransackable | |
def ransackable_attributes(_auth_object = nil) | |
data.first.keys | |
end | |
def ransortable_attributes(auth_object = nil) | |
ransackable_attributes(auth_object) | |
end | |
def ransackable_associations(_auth_object = nil) | |
[] | |
end | |
def klass | |
self | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment