diff --git a/Gemfile b/Gemfile index 3faa67a..8f06e5d 100644 --- a/Gemfile +++ b/Gemfile @@ -24,10 +24,6 @@ gem 'locale', '~> 2.0.5' # FIXME list here all actual dependencies (i.e. the ones in debian/control), # with their GEM names (not the Debian package names) -group :development do - gem 'bullet' -end - group :production do gem 'dalli', '~> 2.7.0' end diff --git a/app/controllers/my_profile/cms_controller.rb b/app/controllers/my_profile/cms_controller.rb index f78e9f5..82bc98b 100644 --- a/app/controllers/my_profile/cms_controller.rb +++ b/app/controllers/my_profile/cms_controller.rb @@ -59,7 +59,7 @@ class CmsController < MyProfileController conditions = ['type != ?', 'RssFeed'] end - @articles = @article.children.includes(:parent).reorder("case when type = 'Folder' then 0 when type ='Blog' then 1 else 2 end, updated_at DESC, name").paginate( + @articles = @article.children.reorder("case when type = 'Folder' then 0 when type ='Blog' then 1 else 2 end, updated_at DESC, name").paginate( :conditions => conditions, :per_page => per_page, :page => params[:npage] diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index 3a70dc4..a8ee4de 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -221,7 +221,7 @@ class ContentViewerController < ApplicationController # relation. posts = posts.native_translations if blog_with_translation?(@page) - @posts = posts.paginate({ :page => params[:npage], :per_page => @page.posts_per_page }.merge(Article.display_filter(user, profile))).includes(:author).to_a + @posts = posts.paginate({ :page => params[:npage], :per_page => @page.posts_per_page }.merge(Article.display_filter(user, profile))).to_a if blog_with_translation?(@page) @posts.replace @posts.map{ |p| p.get_translation_to(FastGettext.locale) }.compact diff --git a/app/models/article.rb b/app/models/article.rb index 61a4c11..da909ba 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -258,7 +258,7 @@ class Article < ActiveRecord::Base # retrieves all articles belonging to the given +profile+ that are not # sub-articles of any other article. scope :top_level_for, lambda { |profile| - {:conditions => [ 'parent_id is null and profile_id = ?', profile.id ], :include => [:profile]} + {:conditions => [ 'parent_id is null and profile_id = ?', profile.id ]} } scope :public, diff --git a/app/models/category.rb b/app/models/category.rb index ab214b9..2c4aa67 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -16,7 +16,7 @@ class Category < ActiveRecord::Base # Finds all top level categories for a given environment. scope :top_level_for, lambda { |environment| - {:conditions => ['parent_id is null and environment_id = ?', environment.id ], :include => [:children]} + {:conditions => ['parent_id is null and environment_id = ?', environment.id ]} } scope :on_level, lambda { |parent| {:conditions => {:parent_id => parent}} } diff --git a/app/models/comment.rb b/app/models/comment.rb index d4d196b..9ad0c9a 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -18,7 +18,7 @@ class Comment < ActiveRecord::Base has_many :children, :class_name => 'Comment', :foreign_key => 'reply_of_id', :dependent => :destroy belongs_to :reply_of, :class_name => 'Comment', :foreign_key => 'reply_of_id' - scope :without_reply, :conditions => ['comments.reply_of_id IS NULL'] + scope :without_reply, :conditions => ['reply_of_id IS NULL'] #FIXME make this test scope :newer_than, lambda { |reference_id| diff --git a/app/models/person.rb b/app/models/person.rb index 4d45004..f732c4e 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -444,7 +444,7 @@ roles] } end def already_reported?(profile) - abuse_reports.includes({:abuse_complaint => :reported}).any? { |report| report.abuse_complaint.reported == profile && report.abuse_complaint.opened? } + abuse_reports.any? { |report| report.abuse_complaint.reported == profile && report.abuse_complaint.opened? } end def register_report(abuse_report, profile) diff --git a/app/models/profile.rb b/app/models/profile.rb index 3931123..c899b2e 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -229,7 +229,7 @@ class Profile < ActiveRecord::Base belongs_to :preferred_domain, :class_name => 'Domain', :foreign_key => 'preferred_domain_id' belongs_to :environment - has_many :articles, :dependent => :destroy, :include => [:profile] + has_many :articles, :dependent => :destroy belongs_to :home_page, :class_name => Article.name, :foreign_key => 'home_page_id' has_many :files, :class_name => 'UploadedFile' diff --git a/app/views/comment/_comment.html.erb b/app/views/comment/_comment.html.erb index 792da43..1b02084 100644 --- a/app/views/comment/_comment.html.erb +++ b/app/views/comment/_comment.html.erb @@ -64,7 +64,7 @@ <% unless comment.replies.blank? || comment.spam? %>