diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-07 08:30:09 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-07 08:30:09 -0800 |
commit | 8aa5d7a393e0bbef8cd3ae9ecf64c2358b802b5f (patch) | |
tree | 65bf0d13754591494117283ac9b8c076cd5799ea /lib/arel/math.rb | |
parent | 2644bcec7dbe3a65277b3a6a141853484171535a (diff) | |
parent | 2158d592c074813471baa8fa20044b683bb156e6 (diff) | |
download | rails-8aa5d7a393e0bbef8cd3ae9ecf64c2358b802b5f.tar.gz rails-8aa5d7a393e0bbef8cd3ae9ecf64c2358b802b5f.tar.bz2 rails-8aa5d7a393e0bbef8cd3ae9ecf64c2358b802b5f.zip |
Merge remote branch 'stiff/master' into omg
* stiff/master:
implemented support for math operations in numeric attributes
Diffstat (limited to 'lib/arel/math.rb')
-rw-r--r-- | lib/arel/math.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/arel/math.rb b/lib/arel/math.rb new file mode 100644 index 0000000000..551b1f1010 --- /dev/null +++ b/lib/arel/math.rb @@ -0,0 +1,21 @@ +module Arel + module Math + + def *(other) + Arel::Nodes::Multiplication.new(self, other) + end + + def +(other) + Arel::Nodes::Addition.new(self, other) + end + + def -(other) + Arel::Nodes::Subtraction.new(self, other) + end + + def /(other) + Arel::Nodes::Division.new(self, other) + end + + end +end
\ No newline at end of file |