diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-25 18:08:47 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-25 18:08:47 -0700 |
commit | 3db95ef6a1bc26540d6908ef47b8d44818a8c305 (patch) | |
tree | 622ccbc21953daab0a86d9f7397834968f8d6b78 /lib | |
parent | 9efbf51adbebcf32787cff6b470218be748b5119 (diff) | |
download | rails-3db95ef6a1bc26540d6908ef47b8d44818a8c305.tar.gz rails-3db95ef6a1bc26540d6908ef47b8d44818a8c305.tar.bz2 rails-3db95ef6a1bc26540d6908ef47b8d44818a8c305.zip |
removing more metaprogramming
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/algebra/value.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/arel/algebra/value.rb b/lib/arel/algebra/value.rb index e363805140..d9fc2e061c 100644 --- a/lib/arel/algebra/value.rb +++ b/lib/arel/algebra/value.rb @@ -1,7 +1,18 @@ module Arel class Value - attributes :value, :relation - deriving :initialize, :== + attr_reader :value, :relation + + def initialize value, relation + @value = value + @relation = relation + end + + def == other + super || + Value === other && + value == other.value && + relation == other.relation + end def bind(relation) Value.new(value, relation) |