app/models/playlist_item.rb
Missing top-level class documentation comment.class PlaylistItem < ActiveRecord::Base belongs_to :stream validates :song, uniqueness: true, unless: :last_song_differs after_create :notify def notifyDo not introduce global variables.
Prefer single-quoted strings when you don't need string interpolation or special symbols. $redis.publish "songs", { song: self }.to_json end def last_song_differs stream.playlist_items.any? && song != stream.playlist_items.last.song endend