When defining associations in classes for Datamapper you don't seem to get the associated model data by default.
As an example:
class Song
include DataMapper::Resource
property :id, Serial
property :name, String
property :artist_id, Integer
belongs_to :artist
end
class Artist
include DataMapper::Resource
property :id, Serial
property :name, String
has n, :songs
end
Song.get(params[:id]).to_json
the song query doesn't perform a join with the artists table by default. How do you perform a join and get the Artist along with the Song in the above example? Querying either class separately works fine. Note, this is an existing db, not created via DataMapper.
Thanks in advance!