Class: Work

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
FriendlyId
Defined in:
app/models/work.rb

Instance Method Summary collapse

Instance Method Details

#normalize_friendly_id(input) ⇒ Object


19
20
21
# File 'app/models/work.rb', line 19

def normalize_friendly_id(input)
	input.to_s.to_slug.normalize.to_s
end

#original_title_slugObject


23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/models/work.rb', line 23

def original_title_slug
	[
		:original_title,
		[:original_title, ->{ original_release_date.strftime('%Y') if original_release_date.present? }],
		[->{ editions.first.platform.display_title if editions.first }, :original_title],
		[->{ editions.first.platform.display_title if editions.first }, ->{ editions.first.region.title if editions.first }, :original_title],
		[:original_title, 2],
		[:original_title, 3],
		[:original_title, 4],
		[:original_title, 5]
	]
end