Przykładzik:
[code]class Post
include DataMapper::Resource
storage_names[:default] = ‘post’
property :id, Serial
property :title, String
property :text, Text
has n, :categories, :through => Resource
end
class Category
include DataMapper::Resource
storage_names[:default] = ‘category’
property :id, Serial
property :name, String
has n, :posts, :through => Resource
end[/code]
- Wiem, jak zmienić nazwę tabel Category i Post. Moje pytanie, jak zmienić nazwę tabeli je łączącej? Narazie tabela ta nazywa się ‘category_posts’.
- Czy da się jakoś globalnie zmienić konwencję nazewniczą tabel?