Class: Alchemy::TagValidations
- Inherits:
-
Object
- Object
- Alchemy::TagValidations
- Defined in:
- app/services/alchemy/tag_validations.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(klass) ⇒ TagValidations
constructor
A new instance of TagValidations.
Constructor Details
#initialize(klass) ⇒ TagValidations
Returns a new instance of TagValidations.
9 10 11 |
# File 'app/services/alchemy/tag_validations.rb', line 9 def initialize(klass) @klass = klass end |
Class Method Details
.call(klass) ⇒ Object
5 6 7 |
# File 'app/services/alchemy/tag_validations.rb', line 5 def self.call(klass) new(klass).call end |
Instance Method Details
#call ⇒ Object
13 14 15 |
# File 'app/services/alchemy/tag_validations.rb', line 13 def call klass.validates :name, presence: true, uniqueness: {case_sensitive: true} end |