|
@@ -25,7 +25,7 @@
|
|
|
##Model
|
|
|
### Admin
|
|
|
```
|
|
|
-has_many :page_ownerships
|
|
|
+has_many :page_managerships
|
|
|
has_many :pages, through: :page_managerships
|
|
|
```
|
|
|
|
|
@@ -41,7 +41,7 @@ belongs_to :page
|
|
|
### Page
|
|
|
```
|
|
|
has_many :page_ownerships
|
|
|
-has_many :admins, through: : page_managerships
|
|
|
+has_many :admins, through: :page_managerships
|
|
|
has_many :posts
|
|
|
has_many :pm_reply_rules, class: MessageReplyRule
|
|
|
|
|
@@ -51,11 +51,32 @@ has_many :pm_reply_rules, class: MessageReplyRule
|
|
|
|
|
|
* facebook_id
|
|
|
* name
|
|
|
+* access_token
|
|
|
+
|
|
|
+### MessageReplyRule
|
|
|
+```
|
|
|
+belongs_to :page
|
|
|
+```
|
|
|
+
|
|
|
+* page_id
|
|
|
+* match_type, [wildcard, keywords]
|
|
|
+* keywords
|
|
|
+* reply\_template\_ids
|
|
|
+* published_at
|
|
|
+
|
|
|
+### MessageReplyTemplate
|
|
|
+```
|
|
|
+belongs_to :page
|
|
|
+```
|
|
|
+
|
|
|
+* page_id
|
|
|
+* content, text
|
|
|
+
|
|
|
|
|
|
### Post
|
|
|
```
|
|
|
belongs_to :page
|
|
|
-has_many: :reply_rules, class: PostReplyRule
|
|
|
+has_many :reply_rules, class: PostReplyRule
|
|
|
```
|
|
|
|
|
|
* page_id
|
|
@@ -64,13 +85,14 @@ has_many: :reply_rules, class: PostReplyRule
|
|
|
### PostReplyRule
|
|
|
```
|
|
|
belongs_to :post
|
|
|
+has_one :template
|
|
|
```
|
|
|
|
|
|
* post_id
|
|
|
-* reply_type, [wildcard, keywords]
|
|
|
+* match_type, [wildcard, keywords]
|
|
|
* keywords
|
|
|
-* reply\_template\_id
|
|
|
-* enable
|
|
|
+* reply\_template\_ids
|
|
|
+* published_at
|
|
|
|
|
|
### PostReplyTemplate
|
|
|
```
|
|
@@ -80,24 +102,15 @@ belongs_to :page
|
|
|
* page_id
|
|
|
* content, text
|
|
|
|
|
|
-### PrivateMessage
|
|
|
+### ReplyHistory
|
|
|
```
|
|
|
belongs_to :page
|
|
|
```
|
|
|
|
|
|
* page_id
|
|
|
+* post_id
|
|
|
* sender\_facebook\_id
|
|
|
* receipt\_facebook\_id
|
|
|
-* message\_reply\_rule\_id
|
|
|
-
|
|
|
-### MessageReplyRule
|
|
|
-```
|
|
|
-belongs_to :page
|
|
|
-```
|
|
|
-
|
|
|
-* page_id
|
|
|
-* reply_type, [wildcard, keywords]
|
|
|
-* keywords
|
|
|
-* reply_content
|
|
|
-* enable
|
|
|
-
|
|
|
+* reply_type
|
|
|
+* reply\_rule\_id
|
|
|
+* reply\_template\_id
|