aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorCharlie Somerville <charlie@charliesomerville.com>2013-03-20 20:42:05 +1100
committerCharlie Somerville <charlie@charliesomerville.com>2013-03-21 19:56:07 +1100
commitc07e1515f7c66f5599cbb3c7e9fe42e166bf3edc (patch)
treec3855a0c2170fa6112b95816e2a3a4c950af26dc /activemodel/lib/active_model
parent70d0537d5550958d7e006787de869ce9046101fc (diff)
downloadrails-c07e1515f7c66f5599cbb3c7e9fe42e166bf3edc.tar.gz
rails-c07e1515f7c66f5599cbb3c7e9fe42e166bf3edc.tar.bz2
rails-c07e1515f7c66f5599cbb3c7e9fe42e166bf3edc.zip
Add version method to top level modules
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/version.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/version.rb b/activemodel/lib/active_model/version.rb
index 7586b02037..35c4b30999 100644
--- a/activemodel/lib/active_model/version.rb
+++ b/activemodel/lib/active_model/version.rb
@@ -1,10 +1,11 @@
module ActiveModel
- module VERSION #:nodoc:
- MAJOR = 4
- MINOR = 0
- TINY = 0
- PRE = "beta1"
+ # Returns the version of the currently loaded ActiveModel as a Gem::Version
+ def self.version
+ Gem::Version.new "4.0.0.beta1"
+ end
- STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
+ module VERSION #:nodoc:
+ MAJOR, MINOR, TINY, PRE = ActiveModel.version.segments
+ STRING = ActiveModel.version.to_s
end
end