diff --git a/app/models/song.rb b/app/models/song.rb index 2713254..128d6d1 100644 --- a/app/models/song.rb +++ b/app/models/song.rb @@ -5,6 +5,8 @@ class Song < ActiveRecord::Base has_many :setlists, through: :slots has_many :shows, -> { uniq }, through: :setlists + to_param :name + def debut_show performed_shows.last end @@ -13,10 +15,6 @@ def performed_shows @performed_shows ||= shows.performed end - def to_param - "#{id}-#{CGI.escape(name).downcase}" - end - def merge!(other_song) other_song.slots.each do |slot| slot.song = self diff --git a/app/models/venue.rb b/app/models/venue.rb index ce56c49..d7a08a1 100644 --- a/app/models/venue.rb +++ b/app/models/venue.rb @@ -1,6 +1,7 @@ class Venue < ActiveRecord::Base include Showable + to_param :name has_many :shows def merge!(other_venue)