Skip to content

Commit

Permalink
Use to_param and allow songs with periods to be seen, closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
qrush committed Apr 24, 2014
1 parent 351fbf8 commit 4345df4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/models/song.rb
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/models/venue.rb
@@ -1,6 +1,7 @@
class Venue < ActiveRecord::Base
include Showable

to_param :name
has_many :shows

def merge!(other_venue)
Expand Down

0 comments on commit 4345df4

Please sign in to comment.