From a525e4ccd53a0af39b4b8487e8bf3eec80f01938 Mon Sep 17 00:00:00 2001 From: dinedine Date: Sat, 29 Jan 2011 13:05:42 +0100 Subject: [PATCH] fixing bugs --- app/models/theme_asset.rb | 2 +- app/views/admin/assets/_form.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/theme_asset.rb b/app/models/theme_asset.rb index 1891e432..4d87ff0c 100644 --- a/app/models/theme_asset.rb +++ b/app/models/theme_asset.rb @@ -71,7 +71,7 @@ class ThemeAsset def plain_text if RUBY_VERSION =~ /1\.9/ - @plain_text ||= self.source.read.force_encoding('UTF-8') + @plain_text ||= (self.source.read.force_encoding('UTF-8') rescue nil) else @plain_text ||= self.source.read end diff --git a/app/views/admin/assets/_form.html.haml b/app/views/admin/assets/_form.html.haml index 53f5dfe4..7c88c3f5 100644 --- a/app/views/admin/assets/_form.html.haml +++ b/app/views/admin/assets/_form.html.haml @@ -6,7 +6,7 @@ = f.input :name = f.input :source -- unless @asset.custom_fields.empty? +- unless @asset.custom_fields.blank? = render 'admin/custom_fields/custom_form', :form => f, :title => :other_fields, :parent => @asset_collection - if @asset.image? && @asset.valid?