aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-03-23 18:51:16 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-03-23 18:51:16 -0700
commite600384515dc06db2c56ff5be5c18779f7b379a5 (patch)
treefc9938962c6872f06d7afbb765eca41302829636 /activemodel
parente96fa8987b0a2c21604c0b5aeb78bedfac5e1faa (diff)
parent8f05fee1ff26247d6fec8f06f711a60a3c4e48fc (diff)
downloadrails-e600384515dc06db2c56ff5be5c18779f7b379a5.tar.gz
rails-e600384515dc06db2c56ff5be5c18779f7b379a5.tar.bz2
rails-e600384515dc06db2c56ff5be5c18779f7b379a5.zip
Merge pull request #8501 from charliesome/version-to-s
Add #to_s method to VERSION modules
Diffstat (limited to 'activemodel')
-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