app/models/elabs/album.rb in elabs-3.0.0 vs app/models/elabs/album.rb in elabs-4.0.0
- old
+ new
@@ -1,14 +1,16 @@
module Elabs
class Album < ApplicationContentRecord
self.table_name = 'albums'
+ SLUGGABLE_FIELD = :name
ADDITIONAL_HABTM_COUNTER_CACHES = [
%w[projects albums]
].freeze
validates :name, presence: true
validates :description, presence: true
+ validates :slug, presence: true, uniqueness: true
validates_with AssociatedAuthorValidator, relations: %w[project upload]
belongs_to :user
belongs_to :license
belongs_to :language