lib/blind_index/model.rb in blind_index-1.0.1 vs lib/blind_index/model.rb in blind_index-1.0.2
- old
+ new
@@ -59,11 +59,11 @@
bidx_attribute: bidx_attribute,
migrating: migrating
)
define_singleton_method class_method_name do |value|
- BlindIndex.generate_bidx(value, blind_indexes[name])
+ BlindIndex.generate_bidx(value, **blind_indexes[name])
end
define_singleton_method method_name do |value|
ActiveSupport::Deprecation.warn("Use #{class_method_name} instead")
send(class_method_name, value)
@@ -88,17 +88,17 @@
# use include so user can override
include InstanceMethods if blind_indexes.size == 1
end
end
end
- end
- module InstanceMethods
- def read_attribute_for_validation(key)
- if (bi = self.class.blind_indexes[key])
- send(bi[:attribute])
- else
- super
+ module InstanceMethods
+ def read_attribute_for_validation(key)
+ if (bi = self.class.blind_indexes[key])
+ send(bi[:attribute])
+ else
+ super
+ end
end
end
end
end