Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: app/controllers/assets_controller.rb
- ===================================================================
- --- app/controllers/assets_controller.rb (revision 1780)
- +++ app/controllers/assets_controller.rb (working copy)
- @@ -4,8 +4,8 @@
- def show
- content_type = Attachment.content_path.index(params[:dir])
- @asset = content_type ?
- - Resource.find_by_content_type_and_filename(content_type, params[:path].first) :
- - Resource.find_image(params[:path].first)
- + site.resources.find_by_content_type_and_filename(content_type, params[:path].first) :
- + site.resources.find_image(params[:path].first)
- self.cached_references << @asset
- if @asset.nil?
- Index: lib/convert/typo.rb
- ===================================================================
- --- lib/convert/typo.rb (revision 1780)
- +++ lib/convert/typo.rb (working copy)
- @@ -32,8 +32,7 @@
- users
- end
- - def find_or_create_sections(typo_article)
- - site = ::Site.find(1)
- + def find_or_create_sections(site, typo_article)
- home_section = site.sections.home
- section_ids = typo_article.categories.inject([home_section.id]) do |a, c|
- a << (site.sections.find_by_path(::Section.permalink_for(c.name)) || site.sections.create(:name => c.name)).id
- @@ -47,7 +46,7 @@
- default_user :
- ::User.find_by_login(Typo::User.find(typo_article.user_id).login)
- - section_ids = find_or_create_sections(typo_article)
- + section_ids = find_or_create_sections(site, typo_article)
- excerpt, body = !typo_article.extended.blank? ?
- [typo_article.body, typo_article.extended] :
Add Comment
Please, Sign In to add comment