smallfixes, performance
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -48,4 +48,5 @@ console
|
|||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
/config/database.yml
|
/config/database.yml
|
||||||
/config/start_topic.yml
|
/config/start_topic.yml
|
||||||
/config/contact_topic.yml
|
/config/contact_topic.yml
|
||||||
|
.*
|
||||||
@@ -3,7 +3,7 @@ class ThemengruppenController < ApplicationController
|
|||||||
# GET /themengruppen.json
|
# GET /themengruppen.json
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
def index
|
def index
|
||||||
@themengruppen = Themengruppe.accessible_by(current_ability, :show).public.order(:priority).reverse_order
|
@themengruppen = Themengruppe.accessible_by(current_ability, :show).public.includes(:themen)
|
||||||
@toolbar_elements = []
|
@toolbar_elements = []
|
||||||
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()} if can? :new, Themengruppe
|
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()} if can? :new, Themengruppe
|
||||||
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()} if can? :verwalten_all, Themengruppe
|
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()} if can? :verwalten_all, Themengruppe
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class Thema < ActiveRecord::Base
|
|||||||
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",7.month.ago).where("thema_translations.locale"=>I18n.t.locale)}
|
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",7.month.ago).where("thema_translations.locale"=>I18n.t.locale)}
|
||||||
scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true)
|
scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true)
|
||||||
|
|
||||||
default_scope order("themen.priority").reverse_order
|
default_scope includes(:translations).order("themen.priority").reverse_order
|
||||||
# make topic searchable
|
# make topic searchable
|
||||||
searchable do
|
searchable do
|
||||||
text :text
|
text :text
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
ActiveRecordQueryTrace.enabled=true
|
#ActiveRecordQueryTrace.enabled=true
|
||||||
|
|||||||
Reference in New Issue
Block a user