Module: HasUniqueAttribute
- Defined in:
- lib/has_unique_attribute.rb,
lib/has_unique_attribute/version.rb
Constant Summary collapse
- VERSION =
'0.1.4'
Instance Method Summary collapse
Instance Method Details
#has_unique_attribute(attribute_name, index: default_index_name_for_attribute(attribute_name), message: :taken) ⇒ void
This method returns an undefined value.
8 9 10 11 12 13 14 15 |
# File 'lib/has_unique_attribute.rb', line 8 def has_unique_attribute(attribute_name, # rubocop:disable Naming/PredicateName index: default_index_name_for_attribute(attribute_name), message: :taken) assert_unique_index_defined!(index) handle_unique_attribute_on_save(attribute_name, index, ) handle_unique_attribute_on_save!(attribute_name, index, ) end |