new cfpropertylist and added possibility for plist_filename

This commit is contained in:
Jeena Paradies 2010-06-18 17:53:27 +02:00
parent ef9275886e
commit 30931f0384
2 changed files with 8 additions and 4 deletions

View file

@ -77,7 +77,7 @@ module CFPropertyList
def guess(object, options = {})
if(object.is_a?(Fixnum) || object.is_a?(Integer)) then
return CFInteger.new(object)
elsif(object.is_a?(Float)) then
elsif(object.is_a?(Float) || object.is_a?(BigDecimal)) then
return CFReal.new(object)
elsif(object.is_a?(TrueClass) || object.is_a?(FalseClass)) then
return CFBoolean.new(object)

View file

@ -28,10 +28,14 @@ module ActionController
if plist
if plist.is_a? Array
filename = plist.first.class.name.pluralize
unless options.nil? or options[:plist_filename].blank?
if plist.is_a? Array
filename = plist.first.class.name.pluralize
else
filename = "#{plist.class.name}-#{plist.id}"
end
else
filename = "#{plist.class.name}-#{plist.id}"
filename = options[:plist_filename]
end
send_data(