This commit is contained in:
r888888888
2014-07-01 14:34:50 -07:00
parent 7ab3764d0d
commit 04784dc5d9
3 changed files with 10 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ GIT
GEM GEM
remote: http://gemcutter.org/ remote: http://gemcutter.org/
remote: https://rubygems.org/
specs: specs:
actionmailer (4.1.0) actionmailer (4.1.0)
actionpack (= 4.1.0) actionpack (= 4.1.0)
@@ -139,6 +140,7 @@ GEM
rack (1.5.2) rack (1.5.2)
rack-test (0.6.2) rack-test (0.6.2)
rack (>= 1.0) rack (>= 1.0)
radix62 (1.0.1)
rails (4.1.0) rails (4.1.0)
actionmailer (= 4.1.0) actionmailer (= 4.1.0)
actionpack (= 4.1.0) actionpack (= 4.1.0)
@@ -193,6 +195,7 @@ GEM
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (~> 2.8) sprockets (~> 2.8)
statistics2 (0.54) statistics2 (0.54)
streamio-ffmpeg (1.0.0)
term-ansicolor (1.3.0) term-ansicolor (1.3.0)
tins (~> 1.0) tins (~> 1.0)
therubyracer (0.12.1) therubyracer (0.12.1)
@@ -256,6 +259,7 @@ DEPENDENCIES
pg pg
protected_attributes protected_attributes
pry pry
radix62 (~> 1.0.1)
rails (~> 4.1.0) rails (~> 4.1.0)
rmagick rmagick
ruby-imagespec! ruby-imagespec!
@@ -267,6 +271,7 @@ DEPENDENCIES
simplecov simplecov
sprockets-rails sprockets-rails
statistics2 statistics2
streamio-ffmpeg
term-ansicolor term-ansicolor
therubyracer therubyracer
timecop timecop

View File

@@ -39,8 +39,10 @@ class BulkUpdateRequest < ActiveRecord::Base
end end
def create_forum_topic def create_forum_topic
forum_topic = ForumTopic.create(:title => "[bulk] #{title}", :category_id => 1, :original_post_attributes => {:body => reason_with_link}) unless forum_topic_id
update_attribute(:forum_topic_id, forum_topic.id) forum_topic = ForumTopic.create(:title => "[bulk] #{title}", :category_id => 1, :original_post_attributes => {:body => reason_with_link})
update_attribute(:forum_topic_id, forum_topic.id)
end
end end
def reason_with_link def reason_with_link

View File

@@ -20,6 +20,7 @@ mass update aaa -> bbb
<%= dtext_field "bulk_update_request", "reason", :name => "Reason" %> <%= dtext_field "bulk_update_request", "reason", :name => "Reason" %>
</div> </div>
<%= f.input :forum_topic_id, :hint => " (optional)" %>
<%= f.button :submit, :value => "Submit" %> <%= f.button :submit, :value => "Submit" %>
<%= dtext_preview_button "bulk_update_request", "reason" %> <%= dtext_preview_button "bulk_update_request", "reason" %>
<% end %> <% end %>