Skip to content

Commit 2e37e03

Browse files
authored
Merge pull request #99 from magnolia-development/add-ransackable-attributes-to-import
Define ransackable_attributes for Import and Row
2 parents 109f0c1 + 08768da commit 2e37e03

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

app/models/solidus_importer/import.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def import_file=(path)
3939
self.file = File.open(path, 'r')
4040
end
4141

42+
def self.ransackable_attributes(_auth_object = nil)
43+
["created_at", "file", "file_content_type", "file_file_name", "file_file_size", "file_updated_at", "id", "id_value", "import_type", "messages", "state", "updated_at"]
44+
end
45+
4246
class << self
4347
def available_types
4448
SolidusImporter::Import.select(:import_type).order(:import_type).group(:import_type).pluck(:import_type)

app/models/solidus_importer/row.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ class Row < ApplicationRecord
2222

2323
validates :data, presence: true, allow_blank: false
2424
validates :state, presence: true, allow_blank: false
25+
26+
def self.ransackable_attributes(_auth_object = nil)
27+
["created_at", "data", "id", "id_value", "import_id", "messages", "state", "updated_at"]
28+
end
2529
end
2630
end

0 commit comments

Comments
 (0)