id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1253	Update Plugin Version in Config.DB for enabled plugins only, please add to trunk :)	bowtie	bowtie	"I noticed that the Plugins DB was not being updated when a plugin version changed, so here is a fix. for active plugins only.

{{{#!diff

Index: lib/Padre/PluginManager.pm
===================================================================
--- lib/Padre/PluginManager.pm	(revision 14945)
+++ lib/Padre/PluginManager.pm	(working copy)
@@ -656,6 +656,11 @@
 			$locale->AddCatalogLookupPathPrefix($dir);
 		}
 	}
+	
+	# update version for enabled plugins
+	Padre::DB::Plugin->update_version(
+		$module => $module->VERSION,
+	);
 
 	# FINALLY we can enable the plug-in
 	$plugin->enable;
@@ -1241,4 +1246,3 @@
 # LICENSE
 # This program is free software; you can redistribute it and/or
 # modify it under the same terms as Perl 5 itself.
-
}}}

{{{#!diff
Index: lib/Padre/DB/Plugin.pm
===================================================================
--- lib/Padre/DB/Plugin.pm	(revision 14945)
+++ lib/Padre/DB/Plugin.pm	(working copy)
@@ -26,6 +26,14 @@
 	);
 }
 
+# Set version for an object
+sub update_version {
+	Padre::DB->do(
+		'update plugin set version = ? where name = ?', {},
+		$_[2], $_[1],
+	);
+}
+
 1;
 
 __END__
@@ -259,6 +267,14 @@
 
 Returns true, or throws an exception on error.
 
+=head2 update_version
+
+	Padre::DB::Plugin->update_version(
+		$module => $module->VERSION,
+	);
+
+Update Version of Plugin, enables Config.DB to be keeped upto date.
+
 =head1 ACCESSORS
 
 =head2 name
}}}

a P-P-Cookbook by product :)"	enhancement	closed	major		plugins	0.86	fixed	Plugin version	Alias
