diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-10 23:20:00 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-04-10 23:20:00 +0400 |
commit | 0ae892007dac045e58cab793806f778b90ce6c2e (patch) | |
tree | 41beb9d808fa23b8dfff6119e4c6faa1d630e97d /app | |
parent | 0415566b3796f500e7f694a0aee4882752d150c1 (diff) |
Remove Wiki and db table since we use gollum now
Diffstat (limited to 'app')
-rw-r--r-- | app/contexts/search_context.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 1 | ||||
-rw-r--r-- | app/models/wiki.rb | 55 |
3 files changed, 1 insertions, 57 deletions
diff --git a/app/contexts/search_context.rb b/app/contexts/search_context.rb index 9becb8d674f..de6542e82f4 100644 --- a/app/contexts/search_context.rb +++ b/app/contexts/search_context.rb @@ -13,7 +13,7 @@ class SearchContext result[:projects] = Project.where(id: project_ids).search(query).limit(10) result[:merge_requests] = MergeRequest.where(project_id: project_ids).search(query).limit(10) result[:issues] = Issue.where(project_id: project_ids).search(query).limit(10) - result[:wiki_pages] = Wiki.where(project_id: project_ids).search(query).limit(10) + result[:wiki_pages] = [] result end diff --git a/app/models/project.rb b/app/models/project.rb index a3357373d02..cad8f1666d3 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -53,7 +53,6 @@ class Project < ActiveRecord::Base has_many :snippets, dependent: :destroy has_many :deploy_keys, dependent: :destroy, class_name: "Key", foreign_key: "project_id" has_many :hooks, dependent: :destroy, class_name: "ProjectHook" - has_many :wikis, dependent: :destroy has_many :protected_branches, dependent: :destroy has_many :user_team_project_relationships, dependent: :destroy diff --git a/app/models/wiki.rb b/app/models/wiki.rb deleted file mode 100644 index 7f488ca7625..00000000000 --- a/app/models/wiki.rb +++ /dev/null @@ -1,55 +0,0 @@ -# == Schema Information -# -# Table name: wikis -# -# id :integer not null, primary key -# title :string(255) -# content :text -# project_id :integer -# created_at :datetime not null -# updated_at :datetime not null -# slug :string(255) -# user_id :integer -# - -class Wiki < ActiveRecord::Base - attr_accessible :title, :content, :slug - - belongs_to :project - belongs_to :user - has_many :notes, as: :noteable, dependent: :destroy - - validates :content, presence: true - validates :user, presence: true - validates :title, presence: true, length: 1..250 - - before_update :set_slug - - scope :ordered, order("created_at DESC") - - def to_param - slug - end - - class << self - def search(query) - where("title like :query OR content like :query", query: "%#{query}%") - end - end - - protected - - def self.regenerate_from wiki - regenerated_field = [:slug, :content, :title] - - new_wiki = Wiki.new - regenerated_field.each do |field| - new_wiki.send("#{field}=", wiki.send(field)) - end - new_wiki - end - - def set_slug - self.slug = self.title.parameterize - end -end |