Class: Alchemy::TagValidations

Inherits:
Object
  • Object
show all
Defined in:
app/services/alchemy/tag_validations.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#callObject



13
14
15
# File 'app/services/alchemy/tag_validations.rb', line 13

def call
  klass.validates :name, presence: true, uniqueness: {case_sensitive: true}
end