Skip to content

Commit

Permalink
decreases truncation size for activity logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamed Ramezanian committed Mar 7, 2013
1 parent 7170f72 commit d51c790
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/controllers/comments_controller.rb
Expand Up @@ -56,7 +56,7 @@ def create
if @comment.save

record_activity %Q(دیدگاهی جدید برای خبر
#{view_context.link_to @story.title.truncate(50),
#{view_context.link_to @story.title.truncate(40),
story_path(@story, :anchor => "comment_#{@comment.id}")} ایجاد کرد)

UserMailer.delay.comment_reply(@comment.id) unless @comment.parent.nil?
Expand All @@ -79,7 +79,7 @@ def update
respond_to do |format|
if @comment.update_attributes(params[:comment])
record_activity %Q(دیدگاه در خبر
#{view_context.link_to @story.title.truncate(50),
#{view_context.link_to @story.title.truncate(40),
story_path(@story, :anchor => "comment_#{@comment.id}")} را ویرایش کرد)

format.html { redirect_to story_path(@comment.story),
Expand All @@ -99,7 +99,7 @@ def destroy
@comment.destroy

record_activity %Q(دیدگاه در خبر
#{view_context.link_to @story.title.truncate(50),
#{view_context.link_to @story.title.truncate(40),
story_path(@story, :anchor => "comment_#{@comment.id}")} را حذف کرد)

respond_to do |format|
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/stories_controller.rb
Expand Up @@ -94,7 +94,7 @@ def create
if @story.save

record_activity %Q(خبر
#{view_context.link_to @story.title.truncate(50),
#{view_context.link_to @story.title.truncate(40),
story_path(@story)} را ایجاد کرد)

format.html { redirect_to root_path, only_path: true,
Expand All @@ -121,7 +121,7 @@ def update
if @story.update_attributes(params[:story])

record_activity %Q(خبر
#{view_context.link_to @story.title.truncate(50),
#{view_context.link_to @story.title.truncate(40),
story_path(@story)} را ویرایش کرد)

if @story.published?
Expand All @@ -148,7 +148,7 @@ def destroy
@story.update_attributes({remover: current_user}, without_protection: true)

record_activity %Q(خبر
#{view_context.link_to @story.title.truncate(50),
#{view_context.link_to @story.title.truncate(40),
story_path(@story)} را حذف کرد)

respond_to do |format|
Expand All @@ -168,7 +168,7 @@ def publish
rate_user(1) if current_user #rate for user who publish a story

record_activity %Q(خبر
#{view_context.link_to @story.title.truncate(50),
#{view_context.link_to @story.title.truncate(40),
story_path(@story)} را منتشر کرد)

format.html { redirect_to story_path(@story),
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/votes_controller.rb
Expand Up @@ -64,11 +64,11 @@ def record_log(vote)

if vote.voteable_type == "Story"
record_activity %Q(به خبر
#{view_context.link_to story.title.truncate(50), story_path(story)} امتیاز
#{view_context.link_to story.title.truncate(40), story_path(story)} امتیاز
#{rating.name} را داد)
elsif vote.voteable_type == "Comment"
record_activity %Q(به
دیدگاه #{view_context.link_to comment.content.truncate(50),
دیدگاه #{view_context.link_to comment.content.truncate(40),
story_path(comment.story, :anchor => "comment_#{comment.id}")} امتیاز
#{rating.name} را داد)
end
Expand Down

0 comments on commit d51c790

Please sign in to comment.