lib/gdshowsdb/models/song_ref.rb in gdshowsdb-4.0.0 vs lib/gdshowsdb/models/song_ref.rb in gdshowsdb-4.0.1
- old
+ new
@@ -6,10 +6,10 @@
friendly_id :slug
has_many :songs, :foreign_key => :song_ref_uuid, :primary_key => :uuid
has_many :song_occurences, :foreign_key => :song_ref_uuid, :primary_key => :uuid
- has_many :shows, :through => :song_occurences, :foreign_key => :song_ref_uuid
+ has_many :shows, -> {distinct}, :through => :song_occurences, :foreign_key => :song_ref_uuid
accepts_nested_attributes_for :song_occurences
def self.create_from(spec)
song_ref = SongRef.new
\ No newline at end of file