Created
February 22, 2019 13:36
-
-
Save denisoster/d162e5a486205916abfed3de6fddec1f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def attributes_for_save | |
p = proc do |*args| | |
v = args.last | |
v.delete_if(&p) if v.respond_to? :delete_if | |
v.nil? || v.respond_to?(:'empty?') && v.empty? | |
end | |
attributes.delete_if(&p) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment