Changeset c5037a4ce54f151978b2a29e61f78dde36d3cbea
- Timestamp:
- 07/27/10 09:10:14 (6 weeks ago)
- Author:
- Alban Peignier <alban@…>
- Parents:
- cb93cb8c2391bcfdff4eefed378aa47f6a8ef266
- Children:
- 96b960ab28342be2b47c677a1e8a569f8e5cf395
- git-committer:
- Alban Peignier <alban@tryphon.eu> / 2010-07-27T09:10:14Z+0200
- Message:
-
Optimise db usage for PublicController#robots?
- Location:
- app
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rcb93cb8
|
rc5037a4
|
|
| 7 | 7 | append_view_path "#{Rails.root}/templates" |
| 8 | 8 | |
| 9 | | before_filter :assigns_show, :create_user_google_analytics_account, :except => :feed |
| | 9 | before_filter :assigns_show, :create_user_google_analytics_account, :except => [:feed, :robots] |
| 10 | 10 | before_filter :assigns_now |
| 11 | 11 | |
| … |
… |
|
| 36 | 36 | |
| 37 | 37 | def feed |
| 38 | | current_show [{:episodes => [ :show, { :contents => { :episode => [ :contents, :tags, { :show => :host } ] } }, :tags ]}, :host] |
| | 38 | load_show [{:episodes => [ :show, { :contents => { :episode => [ :contents, :tags, { :show => :host } ] } }, :tags ]}, :host] |
| 39 | 39 | render :content_type => "application/rss+xml", :layout => false |
| 40 | 40 | end |
| … |
… |
|
| 54 | 54 | |
| 55 | 55 | def robots |
| | 56 | load_show [{:episodes => {:show => :host }}, {:contents => {:episode => {:show => :host}} }] |
| 56 | 57 | respond_to do |format| |
| 57 | 58 | format.txt { render :layout => false } |
-
|
r439b576
|
rc5037a4
|
|
| 25 | 25 | has_and_belongs_to_many :users |
| 26 | 26 | has_many :episodes, :dependent => :destroy, :order => "`order` desc" |
| | 27 | has_many :contents, :through => :episodes |
| 27 | 28 | has_many :images, :dependent => :destroy |
| 28 | 29 | has_many :posts, :dependent => :destroy, :order => "`created_at` desc" |
-
|
r57cce5e
|
rc5037a4
|
|
| 2 | 2 | |
| 3 | 3 | User-agent: * |
| 4 | | <%- for content in @show.episodes.collect(&:contents).flatten -%> |
| | 4 | <%- for content in @show.contents -%> |
| 5 | 5 | Disallow: <%= url_for_content(content, :only_path => true) %> |
| 6 | 6 | <%- end -%> |