summaryrefslogtreecommitdiff
path: root/spec/integration/fixtures/review_mapping.rb
blob: 709f5abc37186e32b7bd209010c1f23f63b4b381 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
class Review
  attr_accessor :id, :description, :movie
end

class ReviewMapping < Humble::DatabaseMapping
  def run(map)
    map.table :reviews
    map.type Review
    map.primary_key(:id, default: -1)
    map.column :description
    map.belongs_to :movie_id, Movie
  end
end