From a4d8f1ab84bab11e6773aa64d2f4d1e9a3a53ce4 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Fri, 18 Jun 2010 23:36:31 +0200 Subject: [PATCH] only add id to the name if there is one --- lib/rails_extensions.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rails_extensions.rb b/lib/rails_extensions.rb index d73665c..45f4cc4 100644 --- a/lib/rails_extensions.rb +++ b/lib/rails_extensions.rb @@ -11,8 +11,10 @@ module ActionController unless filename = options.delete(:plist_filename) if plist.is_a? Array filename = plist.first.class.name.pluralize + ".plist" - else + elsif plist.respond_to?(:id) filename = "#{plist.class.name}-#{plist.id}.plist" + else + filename = "#{plist.class.name}-data.plist" end end