質問編集履歴
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -53,4 +53,14 @@
|
|
53
53
|
belongs_to :store, foreign_key: 'site_id', class_name: 'Store'
|
54
54
|
end
|
55
55
|
|
56
|
+
```
|
57
|
+
|
58
|
+
|
59
|
+
尚、こういうことも試しましたが、
|
60
|
+
こうすると、既存のstoreのidがsite_idに書き換わってしまうため、断念しました。
|
61
|
+
|
62
|
+
```
|
63
|
+
class Store < ActiveRecord::Base
|
64
|
+
self.primary_key = :site_id
|
65
|
+
end
|
56
66
|
```
|