Module: Concerns::Model::BaseThing

Extended by:
ActiveSupport::Concern
Included in:
Thing
Defined in:
lib/concerns/model/base_thing.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#listsObject

custom associations



48
# File 'lib/concerns/model/base_thing.rb', line 48

def lists; List.where(thing_type: self.to_s); end

#special_characters_excludedObject



50
51
52
53
54
55
56
# File 'lib/concerns/model/base_thing.rb', line 50

def special_characters_excluded
  if name.match(/\//)
    errors[:name] << I18n.t(
      'activerecord.errors.models.thing.attributes.name.unwanted_special_characters_included'
    )
  end
end