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? %> diff --git a/config/environments/development.rb b/config/environments/development.rb index 32b8379..9bbd40b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -35,10 +35,4 @@ Noosfero::Application.configure do config.assets.debug = true config.consider_all_requests_local = true - - config.after_initialize do - Bullet.enable = true - Bullet.console = true - end - end diff --git a/lib/acts_as_having_posts.rb b/lib/acts_as_having_posts.rb index 9c9c020..68ef4a7 100644 --- a/lib/acts_as_having_posts.rb +++ b/lib/acts_as_having_posts.rb @@ -2,7 +2,7 @@ module ActsAsHavingPosts module ClassMethods def acts_as_having_posts(options = {}) - has_many :posts, { :class_name => 'Article', :foreign_key => 'parent_id', :source => :children, :conditions => [ 'articles.type != ?', 'RssFeed' ], :order => 'published_at DESC, id DESC', :include => [:parent, :profile] }.merge(options) + has_many :posts, { :class_name => 'Article', :foreign_key => 'parent_id', :source => :children, :conditions => [ 'articles.type != ?', 'RssFeed' ], :order => 'published_at DESC, id DESC' }.merge(options) attr_accessor :feed_attrs diff --git a/lib/spammable.rb b/lib/spammable.rb index 2605f9d..eff1206 100644 --- a/lib/spammable.rb +++ b/lib/spammable.rb @@ -12,8 +12,8 @@ module Spammable def self.extended (base) if base.respond_to?(:scope) base.class_eval do - scope :without_spam, :conditions => ["#{base.table_name}.spam IS NULL OR #{base.table_name}.spam = ?", false] - scope :spam, :conditions => ["#{base.table_name}.spam = ?", true] + scope :without_spam, :conditions => ['spam IS NULL OR spam = ?', false] + scope :spam, :conditions => ['spam = ?', true] end end end diff --git a/test/functional/manage_products_controller_test.rb b/test/functional/manage_products_controller_test.rb index e1b9323..2285b77 100644 --- a/test/functional/manage_products_controller_test.rb +++ b/test/functional/manage_products_controller_test.rb @@ -150,7 +150,7 @@ class ManageProductsControllerTest < ActionController::TestCase category2 = fast_create(ProductCategory, :name => 'Category 2', :parent_id => category1.id) category3 = fast_create(ProductCategory, :name => 'Category 3', :parent_id => category2.id) get :new, :profile => @enterprise.identifier - assert_tag :tag => 'select', :attributes => { :id => 'category_id' }, :descendant => { :tag => 'option', :content => category1.name + " »" } + assert_tag :tag => 'select', :attributes => { :id => 'category_id' }, :descendant => { :tag => 'option', :content => category1.name } end should "create new product categorized" do -- libgit2 0.21.2