X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=21f055b267b78a5a3d3599d9d388aaee6b97fea8;hb=d77de08ffe5145db6ac10b5c34cac5914a17b27f;hp=39bf2e8c8b14adcb96d724b4ee255a76009ad5ac;hpb=99a74c4ad4029a2fde7665d47cd444c041737c58;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 39bf2e8..21f055b 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -62,6 +62,29 @@ particular which module inherits off which. =head1 METHODS +=head2 schema_version + +Returns the current schema class' $VERSION + +=cut + +sub schema_version { + my ($self) = @_; + my $class = ref($self)||$self; + + # does -not- use $schema->VERSION + # since that varies in results depending on if version.pm is installed, and if + # so the perl or XS versions. If you want this to change, bug the version.pm + # author to make vpp and vxs behave the same. + + my $version; + { + no strict 'refs'; + $version = ${"${class}::VERSION"}; + } + return $version; +} + =head2 register_class =over 4