-
-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
It would be good to don't strip on binary columns (@sql_type="mediumblob", @type=:binary). I had the callback added to ApplicationRecord, and had "invalid byte sequence in UTF-8" error on a binary column. I think strip_record could check the column.
Also, supporting a symbol for except or only to be a method name, or supporting proc, could be used to call strip_attributes in ApplicationRecord, and then define a method with the excluded columns:
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
strip_attributes allow_empty: true, except: :not_stripped_columns
endclass Picture < ApplicationRecord
def not_strippped_columns
[:picture]
end
endOr with proc:
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
strip_attributes allow_empty: true, except: proc { |record| record.not_stripped_columns }
endMetadata
Metadata
Assignees
Labels
No labels