diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-17 23:35:51 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-17 23:35:51 -0700 |
commit | 7a068384b74813b3ea9a309d237c6ce8e8fde5d6 (patch) | |
tree | b0c39ba5e687c03cef1dfa93356eacb04ede5b8f /lib/arel/primitives | |
parent | 6e1450a2a646e416aaea003eff19b7703c563bed (diff) | |
download | rails-7a068384b74813b3ea9a309d237c6ce8e8fde5d6.tar.gz rails-7a068384b74813b3ea9a309d237c6ce8e8fde5d6.tar.bz2 rails-7a068384b74813b3ea9a309d237c6ce8e8fde5d6.zip |
still faster
Diffstat (limited to 'lib/arel/primitives')
-rw-r--r-- | lib/arel/primitives/attribute.rb | 6 | ||||
-rw-r--r-- | lib/arel/primitives/value.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/arel/primitives/attribute.rb b/lib/arel/primitives/attribute.rb index cb564c1587..eeea495b09 100644 --- a/lib/arel/primitives/attribute.rb +++ b/lib/arel/primitives/attribute.rb @@ -38,12 +38,16 @@ module Arel end def original_relation - original_attribute.relation + @original_relation ||= original_attribute.relation end def original_attribute @original_attribute ||= history.detect { |a| !a.join? } end + + def circle(relation) + relation[self] + end module Transformations def self.included(klass) diff --git a/lib/arel/primitives/value.rb b/lib/arel/primitives/value.rb index b4bddd0b0c..7751390be6 100644 --- a/lib/arel/primitives/value.rb +++ b/lib/arel/primitives/value.rb @@ -24,5 +24,9 @@ module Arel def bind(relation) Value.new(value, relation) end + + def circle(relation) + bind(relation) + end end end
\ No newline at end of file |