lib/blind_index/extensions.rb in blind_index-0.3.0 vs lib/blind_index/extensions.rb in blind_index-0.3.2

- old
+ new

@@ -65,7 +65,17 @@ end super(klass, table, attribute, value) end end end + + module DynamicMatchers + def valid? + attribute_names.all? { |name| model.columns_hash[name] || model.reflect_on_aggregation(name.to_sym) || blind_index?(name.to_sym) } + end + + def blind_index?(name) + model.respond_to?(:blind_indexes) && model.blind_indexes[name] + end + end end end