Sha256: 39019695d7d3de67561f07affa210e99b903c687262bade34e4a9460198fe240
Contents?: true
Size: 513 Bytes
Versions: 46
Compression:
Stored size: 513 Bytes
Contents
module Shipit module ConditionalAttributes extend ActiveSupport::Concern module ClassMethods def inclusion_method_for(attribute) @inclusion_cache ||= {} @inclusion_cache.fetch(attribute) do method = "include_#{attribute}?" method_defined?(method) && method end end end def filter(*) super.reject do |attribute| method = self.class.inclusion_method_for(attribute) method && !send(method) end end end end
Version data entries
46 entries across 46 versions & 1 rubygems