22 lines
496 B
Ruby
22 lines
496 B
Ruby
module JamRuby
|
|
class Genre < ActiveRecord::Base
|
|
|
|
self.primary_key = 'id'
|
|
|
|
# bands
|
|
has_many :band_genres, class_name: "JamRuby::BandGenre"
|
|
has_many :bands, class_name: "JamRuby::Band", :through => :band_genres
|
|
|
|
|
|
# music sessions
|
|
has_many :music_sessions, :class_name => "JamRuby::MusicSession"
|
|
|
|
# genres
|
|
has_and_belongs_to_many :recordings, :class_name => "JamRuby::Recording", :join_table => "recordings_genres"
|
|
|
|
|
|
def to_s
|
|
description
|
|
end
|
|
end
|
|
end |