From b7cdc5176e46d081662ecdfc0d1976a1346b5d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarmo=20T=C3=A4nav?= Date: Tue, 26 Jan 2010 13:51:14 +0200 Subject: [PATCH] Made it possible to call has_details multiple times on the same column --- lib/has_details.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/has_details.rb b/lib/has_details.rb index 5344aa2..4ac1978 100644 --- a/lib/has_details.rb +++ b/lib/has_details.rb @@ -37,7 +37,10 @@ def has_details(options = {}) raise(ArgumentError, "You must be supply at least one field in the configuration hash") unless configuration.keys.size > 0 # raise(Exception, "A #{configuration[:column]} column must be present in the database for this plugin.") unless columns.include?(:details) - serialize configuration.delete(:column), Hash + col = configuration.delete(:column).to_s + unless serialized_attributes[col] + serialize col, Hash + end configuration.each do |f,t|