Sha256: 6c7de6038ebd33291b0ee9a84b4fccdaa7e617e3dc5fd4240b41f1272d9f2fb7

Contents?: true

Size: 488 Bytes

Versions: 10

Compression:

Stored size: 488 Bytes

Contents

module Binda
  class Board < ApplicationRecord

  	include FieldableAssociations

		belongs_to :structure, required: true

		validates :name, presence: true
		validates :slug, uniqueness: true

		# Slug
		extend FriendlyId
		friendly_id :name, use: [:slugged, :finders]

		# Friendly id preference on slug generation
		#
		# Method inherited from friendly id 
		# @see https://github.com/norman/friendly_id/issues/436
		def should_generate_new_friendly_id?
			slug.blank?
		end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
binda-0.1.9 app/models/binda/board.rb
binda-0.1.8 app/models/binda/board.rb
binda-0.1.7 app/models/binda/board.rb
binda-0.1.6 app/models/binda/board.rb
binda-0.1.5 app/models/binda/board.rb
binda-0.1.4 app/models/binda/board.rb
binda-0.1.3 app/models/binda/board.rb
binda-0.1.2 app/models/binda/board.rb
binda-0.1.1 app/models/binda/board.rb
binda-0.1.0 app/models/binda/board.rb