Kill trailing whitespace in ruby files

This commit is contained in:
小太
2013-03-19 23:10:10 +11:00
parent c107f96cec
commit cba839ba76
319 changed files with 2710 additions and 2710 deletions

View File

@@ -11,34 +11,34 @@ class ForumTopic < ActiveRecord::Base
validates_presence_of :title, :creator_id
validates_associated :original_post
accepts_nested_attributes_for :original_post
module SearchMethods
def title_matches(title)
where("text_index @@ plainto_tsquery(E?)", title.to_escaped_for_tsquery_split)
end
def active
where("is_deleted = false")
end
def search(params)
q = scoped
return q if params.blank?
if params[:title_matches].present?
q = q.title_matches(params[:title_matches])
end
if params[:title].present?
q = q.where("title = ?", params[:title])
end
q
end
end
extend SearchMethods
def editable_by?(user)
creator_id == user.id || user.is_janitor?
end
@@ -50,15 +50,15 @@ class ForumTopic < ActiveRecord::Base
def initialize_creator
self.creator_id = CurrentUser.id
end
def initialize_updater
self.updater_id = CurrentUser.id
end
def last_page
(posts.count / Danbooru.config.posts_per_page.to_f).ceil
end
def presenter(forum_posts)
@presenter ||= ForumTopicPresenter.new(self, forum_posts)
end