Skip to content

Commit

Permalink
[modify] twitter post when merge branch
Browse files Browse the repository at this point in the history
  • Loading branch information
itowtips committed Dec 8, 2020
1 parent 4a78270 commit f9378b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions app/models/concerns/cms/addon/sns_poster.rb
Expand Up @@ -10,11 +10,11 @@ module SnsPoster

included do

field :twitter_auto_post, type: String, metadata: { branch: false }
field :twitter_auto_post, type: String
field :twitter_user_id, type: String, metadata: { branch: false }
field :twitter_post_id, type: String, metadata: { branch: false }
field :sns_auto_delete, type: String, metadata: { branch: false }
field :edit_auto_post, type: String, metadata: { branch: false }
field :sns_auto_delete, type: String
field :edit_auto_post, type: String
field :twitter_posted, type: Array, default: [], metadata: { branch: false }
field :twitter_post_error, type: String, metadata: { branch: false }

Expand Down Expand Up @@ -59,6 +59,7 @@ def twitter_url(post_id, user_id)

def twitter_post_enabled?
return false unless use_twitter_post?
return false if respond_to?(:branch?) && branch?
return true if edit_auto_post_enabled?
return false if twitter_posted.present?
true
Expand Down
1 change: 0 additions & 1 deletion app/views/cms/agents/addons/sns_poster/_form.html.erb
@@ -1,6 +1,5 @@
<%
return "" unless @cur_site.twitter_token_enabled?
return "" if @item.try(:branch?)

addon ||= local_assigns.fetch(:addon, {})
addon[:display_body] = "hide"
Expand Down
1 change: 0 additions & 1 deletion app/views/cms/agents/addons/sns_poster/_show.html.erb
@@ -1,5 +1,4 @@
<% return "" unless @cur_site.twitter_token_enabled? %>
<% return "" if @item.try(:branch?)%>

<dl class="see">
<% if @cur_site.twitter_token_enabled? %>
Expand Down

0 comments on commit f9378b0

Please sign in to comment.