diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-13 22:52:18 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-13 22:52:18 -0700 |
commit | 384008b04b48735a73dbba5a7d4a18e794c897ad (patch) | |
tree | b3b3c3b78a274d01f30c8aaeca69545f2110e817 /lib | |
parent | a8cf09a5b6bd4019e0f68e70d62d6e6be6b3784b (diff) | |
download | rails-384008b04b48735a73dbba5a7d4a18e794c897ad.tar.gz rails-384008b04b48735a73dbba5a7d4a18e794c897ad.tar.bz2 rails-384008b04b48735a73dbba5a7d4a18e794c897ad.zip |
annotated abstraction
- in compound
- created superclass for the create/insert/update write operations, marked :call as abstract
Diffstat (limited to 'lib')
-rw-r--r-- | lib/active_relation/relations.rb | 1 | ||||
-rw-r--r-- | lib/active_relation/relations/compound.rb | 2 | ||||
-rw-r--r-- | lib/active_relation/relations/deletion.rb | 2 | ||||
-rw-r--r-- | lib/active_relation/relations/insertion.rb | 2 | ||||
-rw-r--r-- | lib/active_relation/relations/update.rb | 2 | ||||
-rw-r--r-- | lib/active_relation/sql.rb | 5 |
6 files changed, 9 insertions, 5 deletions
diff --git a/lib/active_relation/relations.rb b/lib/active_relation/relations.rb index f992fca8be..7776fd3d18 100644 --- a/lib/active_relation/relations.rb +++ b/lib/active_relation/relations.rb @@ -1,5 +1,6 @@ require 'active_relation/relations/relation' require 'active_relation/relations/compound' +require 'active_relation/relations/writing' require 'active_relation/relations/table' require 'active_relation/relations/join' require 'active_relation/relations/aggregation' diff --git a/lib/active_relation/relations/compound.rb b/lib/active_relation/relations/compound.rb index a10b7588e7..fac0939c6f 100644 --- a/lib/active_relation/relations/compound.rb +++ b/lib/active_relation/relations/compound.rb @@ -1,5 +1,7 @@ module ActiveRelation class Compound < Relation + abstract :==, :descend + attr_reader :relation delegate :joins, :selects, :orders, :groupings, :table_sql, :inserts, :limit, :offset, :name, :alias, :aggregation?, :alias?, :prefix_for, :column_for, diff --git a/lib/active_relation/relations/deletion.rb b/lib/active_relation/relations/deletion.rb index c5906e8bc8..0fcf523efe 100644 --- a/lib/active_relation/relations/deletion.rb +++ b/lib/active_relation/relations/deletion.rb @@ -1,5 +1,5 @@ module ActiveRelation - class Deletion < Compound + class Deletion < Writing def initialize(relation) @relation = relation end diff --git a/lib/active_relation/relations/insertion.rb b/lib/active_relation/relations/insertion.rb index 036db1a319..ce065b64c1 100644 --- a/lib/active_relation/relations/insertion.rb +++ b/lib/active_relation/relations/insertion.rb @@ -1,5 +1,5 @@ module ActiveRelation - class Insertion < Compound + class Insertion < Writing attr_reader :record def initialize(relation, record) diff --git a/lib/active_relation/relations/update.rb b/lib/active_relation/relations/update.rb index 0914cda035..a51f248866 100644 --- a/lib/active_relation/relations/update.rb +++ b/lib/active_relation/relations/update.rb @@ -1,5 +1,5 @@ module ActiveRelation - class Update < Compound + class Update < Writing attr_reader :assignments def initialize(relation, assignments) diff --git a/lib/active_relation/sql.rb b/lib/active_relation/sql.rb index e5a4eed08b..0d233b307e 100644 --- a/lib/active_relation/sql.rb +++ b/lib/active_relation/sql.rb @@ -5,10 +5,11 @@ module ActiveRelation end class Formatter + abstract :attribute, :select, :value + attr_reader :engine - include Quoting - abstract :attribute, :select, :value + include Quoting def initialize(engine) @engine = engine |