aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-18 12:59:29 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-18 12:59:29 -0700
commitd51139751eae2be6ee32b44edec39fcf09ed2333 (patch)
treec87d1bbb97cc5ba9f496f7c76fcf2fe7eaeee9f4
parentd27ab7bb8ba0d8f136af2ed955d9e489ba45daec (diff)
downloadrails-d51139751eae2be6ee32b44edec39fcf09ed2333.tar.gz
rails-d51139751eae2be6ee32b44edec39fcf09ed2333.tar.bz2
rails-d51139751eae2be6ee32b44edec39fcf09ed2333.zip
officially renamed active_relation to arel
-rw-r--r--README10
-rw-r--r--doc/TODO2
-rw-r--r--lib/active_relation.rb12
-rw-r--r--lib/active_relation/engines.rb1
-rw-r--r--lib/active_relation/extensions.rb6
-rw-r--r--lib/active_relation/primitives.rb4
-rw-r--r--lib/active_relation/relations.rb17
-rw-r--r--lib/arel.rb12
-rw-r--r--lib/arel/.DS_Store (renamed from lib/active_relation/.DS_Store)bin6148 -> 6148 bytes
-rw-r--r--lib/arel/engines.rb1
-rw-r--r--lib/arel/engines/engine.rb (renamed from lib/active_relation/engines/engine.rb)2
-rw-r--r--lib/arel/extensions.rb6
-rw-r--r--lib/arel/extensions/array.rb (renamed from lib/active_relation/extensions/array.rb)0
-rw-r--r--lib/arel/extensions/class.rb (renamed from lib/active_relation/extensions/class.rb)0
-rw-r--r--lib/arel/extensions/hash.rb (renamed from lib/active_relation/extensions/hash.rb)0
-rw-r--r--lib/arel/extensions/nil_class.rb (renamed from lib/active_relation/extensions/nil_class.rb)0
-rw-r--r--lib/arel/extensions/object.rb (renamed from lib/active_relation/extensions/object.rb)2
-rw-r--r--lib/arel/extensions/range.rb (renamed from lib/active_relation/extensions/range.rb)0
-rw-r--r--lib/arel/predicates.rb (renamed from lib/active_relation/predicates.rb)2
-rw-r--r--lib/arel/primitives.rb4
-rw-r--r--lib/arel/primitives/attribute.rb (renamed from lib/active_relation/primitives/attribute.rb)2
-rw-r--r--lib/arel/primitives/expression.rb (renamed from lib/active_relation/primitives/expression.rb)2
-rw-r--r--lib/arel/primitives/value.rb (renamed from lib/active_relation/primitives/value.rb)2
-rw-r--r--lib/arel/relations.rb17
-rw-r--r--lib/arel/relations/alias.rb (renamed from lib/active_relation/relations/alias.rb)2
-rw-r--r--lib/arel/relations/compound.rb (renamed from lib/active_relation/relations/compound.rb)2
-rw-r--r--lib/arel/relations/deletion.rb (renamed from lib/active_relation/relations/deletion.rb)2
-rw-r--r--lib/arel/relations/grouping.rb (renamed from lib/active_relation/relations/grouping.rb)2
-rw-r--r--lib/arel/relations/insertion.rb (renamed from lib/active_relation/relations/insertion.rb)2
-rw-r--r--lib/arel/relations/join.rb (renamed from lib/active_relation/relations/join.rb)2
-rw-r--r--lib/arel/relations/nil.rb (renamed from lib/active_relation/relations/nil.rb)2
-rw-r--r--lib/arel/relations/order.rb (renamed from lib/active_relation/relations/order.rb)2
-rw-r--r--lib/arel/relations/projection.rb (renamed from lib/active_relation/relations/projection.rb)2
-rw-r--r--lib/arel/relations/relation.rb (renamed from lib/active_relation/relations/relation.rb)2
-rw-r--r--lib/arel/relations/selection.rb (renamed from lib/active_relation/relations/selection.rb)2
-rw-r--r--lib/arel/relations/skip.rb (renamed from lib/active_relation/relations/skip.rb)2
-rw-r--r--lib/arel/relations/table.rb (renamed from lib/active_relation/relations/table.rb)2
-rw-r--r--lib/arel/relations/take.rb (renamed from lib/active_relation/relations/take.rb)2
-rw-r--r--lib/arel/relations/update.rb (renamed from lib/active_relation/relations/update.rb)2
-rw-r--r--lib/arel/relations/writing.rb (renamed from lib/active_relation/relations/writing.rb)2
-rw-r--r--lib/arel/sessions/session.rb (renamed from lib/active_relation/sessions/session.rb)2
-rw-r--r--lib/arel/sql.rb (renamed from lib/active_relation/sql.rb)2
-rw-r--r--spec/arel/unit/predicates/binary_spec.rb (renamed from spec/active_relation/unit/predicates/binary_spec.rb)2
-rw-r--r--spec/arel/unit/predicates/equality_spec.rb (renamed from spec/active_relation/unit/predicates/equality_spec.rb)2
-rw-r--r--spec/arel/unit/predicates/in_spec.rb (renamed from spec/active_relation/unit/predicates/in_spec.rb)2
-rw-r--r--spec/arel/unit/primitives/attribute_spec.rb (renamed from spec/active_relation/unit/primitives/attribute_spec.rb)2
-rw-r--r--spec/arel/unit/primitives/expression_spec.rb (renamed from spec/active_relation/unit/primitives/expression_spec.rb)2
-rw-r--r--spec/arel/unit/primitives/value_spec.rb (renamed from spec/active_relation/unit/primitives/value_spec.rb)2
-rw-r--r--spec/arel/unit/relations/alias_spec.rb (renamed from spec/active_relation/unit/relations/alias_spec.rb)2
-rw-r--r--spec/arel/unit/relations/compound_spec.rb (renamed from spec/active_relation/unit/relations/compound_spec.rb)2
-rw-r--r--spec/arel/unit/relations/deletion_spec.rb (renamed from spec/active_relation/unit/relations/deletion_spec.rb)2
-rw-r--r--spec/arel/unit/relations/grouping_spec.rb (renamed from spec/active_relation/unit/relations/grouping_spec.rb)2
-rw-r--r--spec/arel/unit/relations/insertion_spec.rb (renamed from spec/active_relation/unit/relations/insertion_spec.rb)2
-rw-r--r--spec/arel/unit/relations/join_spec.rb (renamed from spec/active_relation/unit/relations/join_spec.rb)2
-rw-r--r--spec/arel/unit/relations/order_spec.rb (renamed from spec/active_relation/unit/relations/order_spec.rb)2
-rw-r--r--spec/arel/unit/relations/projection_spec.rb (renamed from spec/active_relation/unit/relations/projection_spec.rb)2
-rw-r--r--spec/arel/unit/relations/relation_spec.rb (renamed from spec/active_relation/unit/relations/relation_spec.rb)2
-rw-r--r--spec/arel/unit/relations/selection_spec.rb (renamed from spec/active_relation/unit/relations/selection_spec.rb)2
-rw-r--r--spec/arel/unit/relations/skip_spec.rb (renamed from spec/active_relation/unit/relations/skip_spec.rb)2
-rw-r--r--spec/arel/unit/relations/table_spec.rb (renamed from spec/active_relation/unit/relations/table_spec.rb)2
-rw-r--r--spec/arel/unit/relations/take_spec.rb (renamed from spec/active_relation/unit/relations/take_spec.rb)2
-rw-r--r--spec/arel/unit/relations/update_spec.rb (renamed from spec/active_relation/unit/relations/update_spec.rb)2
-rw-r--r--spec/arel/unit/session/session_spec.rb (renamed from spec/active_relation/unit/session/session_spec.rb)2
-rw-r--r--spec/spec_helper.rb4
64 files changed, 93 insertions, 93 deletions
diff --git a/README b/README
index 87e9678df6..bb8c6eb71a 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
== Abstract ==
-ActiveRelation is a Relational Algebra for Ruby. It 1) simplifies the generation of both the simplest and the most complex of SQL queries and it 2) transparently adapts to various RDBMS systems. It is intended to be a framework framework; that is, you can build your own ORM with it, focusing on innovative object and collection modeling as opposed to database compatibility and query generation.
+Arel is a Relational Algebra for Ruby. It 1) simplifies the generation of both the simplest and the most complex of SQL queries and it 2) transparently adapts to various RDBMS systems. It is intended to be a framework framework; that is, you can build your own ORM with it, focusing on innovative object and collection modeling as opposed to database compatibility and query generation.
== A Gentle Introduction ==
@@ -10,9 +10,9 @@ Generating a query with ARel is simple. For example, in order to produce
you construct a table relation and convert it to sql:
- ActiveRelation::Table.new(:users).to_sql
+ Arel::Table.new(:users).to_sql
-In fact, you will probably never call `#to_sql`. Let `users = ActiveRelation::Table.new(:users)`. Rather, you'll work with data from the table directly. You can iterate through all rows in the `users` table like this:
+In fact, you will probably never call `#to_sql`. Let `users = Arel::Table.new(:users)`. Rather, you'll work with data from the table directly. You can iterate through all rows in the `users` table like this:
users.each { |user| ... }
@@ -24,7 +24,7 @@ As you can see, Arel converts the rows from the database into a hash, the values
== Relational Algebra ==
-Arel is based on the Relational Algebra, a mathematical model that is also the inspiration for relational databases. ActiveRelation::Relation objects do not represent queries per se (i.e., they are not object-representations of `SELECT`, `INSERT`, `UPDATE`, or `DELETE` statements), rather they represent a collection of data that you can select from, insert into, update, and delete. For example, to insert a row into the users table, do the following:
+Arel is based on the Relational Algebra, a mathematical model that is also the inspiration for relational databases. Arel::Relation objects do not represent queries per se (i.e., they are not object-representations of `SELECT`, `INSERT`, `UPDATE`, or `DELETE` statements), rather they represent a collection of data that you can select from, insert into, update, and delete. For example, to insert a row into the users table, do the following:
users.insert({users[:name] => 'amy'}) # => INSERT INTO users (users.name) VALUES ('amy')
@@ -62,4 +62,4 @@ The best property of the Relational is compositionality, or closure under all op
== Contributions ==
-I appreciate all contributions to ActiveRelation. There is only one "unusual" requirement I have concerning code style: all specs should be written without mocks, using concrete examples to elicit testable behavior. This has two benefits: it 1) ensures the tests serve as concrete documentation and 2) suits the functional nature of this library, which emphasizes algebraic transformation rather than decoupled components. \ No newline at end of file
+I appreciate all contributions to Arel. There is only one "unusual" requirement I have concerning code style: all specs should be written without mocks, using concrete examples to elicit testable behavior. This has two benefits: it 1) ensures the tests serve as concrete documentation and 2) suits the functional nature of this library, which emphasizes algebraic transformation rather than decoupled components. \ No newline at end of file
diff --git a/doc/TODO b/doc/TODO
index 7a6be568e8..a51a730c90 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,5 +1,5 @@
todo:
-- rename ActiveRelation to arel
+- rename Arel to arel
- incorporate linq vocabularity
- fix complex joining cases:
- extract adapters
diff --git a/lib/active_relation.rb b/lib/active_relation.rb
deleted file mode 100644
index 5b5c91706f..0000000000
--- a/lib/active_relation.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-
-require 'rubygems'
-require 'activesupport'
-require 'activerecord'
-
-require 'active_relation/extensions'
-require 'active_relation/sql'
-require 'active_relation/predicates'
-require 'active_relation/relations'
-require 'active_relation/engines'
-require 'active_relation/primitives' \ No newline at end of file
diff --git a/lib/active_relation/engines.rb b/lib/active_relation/engines.rb
deleted file mode 100644
index 55eb817b88..0000000000
--- a/lib/active_relation/engines.rb
+++ /dev/null
@@ -1 +0,0 @@
-require 'active_relation/engines/engine' \ No newline at end of file
diff --git a/lib/active_relation/extensions.rb b/lib/active_relation/extensions.rb
deleted file mode 100644
index ded830eb8c..0000000000
--- a/lib/active_relation/extensions.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require 'active_relation/extensions/object'
-require 'active_relation/extensions/class'
-require 'active_relation/extensions/array'
-require 'active_relation/extensions/hash'
-require 'active_relation/extensions/range'
-require 'active_relation/extensions/nil_class' \ No newline at end of file
diff --git a/lib/active_relation/primitives.rb b/lib/active_relation/primitives.rb
deleted file mode 100644
index 9909734d24..0000000000
--- a/lib/active_relation/primitives.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'active_relation/primitives/attribute'
-require 'active_relation/primitives/value'
-require 'active_relation/primitives/expression'
-
diff --git a/lib/active_relation/relations.rb b/lib/active_relation/relations.rb
deleted file mode 100644
index d8e211c853..0000000000
--- a/lib/active_relation/relations.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'active_relation/relations/relation'
-require 'active_relation/relations/nil'
-require 'active_relation/relations/compound'
-require 'active_relation/relations/writing'
-require 'active_relation/relations/table'
-require 'active_relation/relations/join'
-require 'active_relation/relations/grouping'
-require 'active_relation/relations/projection'
-require 'active_relation/relations/selection'
-require 'active_relation/relations/order'
-require 'active_relation/relations/take'
-require 'active_relation/relations/skip'
-require 'active_relation/relations/deletion'
-require 'active_relation/relations/insertion'
-require 'active_relation/relations/update'
-require 'active_relation/relations/alias'
-require 'active_relation/sessions/session' \ No newline at end of file
diff --git a/lib/arel.rb b/lib/arel.rb
new file mode 100644
index 0000000000..75489c9c6e
--- /dev/null
+++ b/lib/arel.rb
@@ -0,0 +1,12 @@
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+
+require 'rubygems'
+require 'activesupport'
+require 'activerecord'
+
+require 'arel/extensions'
+require 'arel/sql'
+require 'arel/predicates'
+require 'arel/relations'
+require 'arel/engines'
+require 'arel/primitives' \ No newline at end of file
diff --git a/lib/active_relation/.DS_Store b/lib/arel/.DS_Store
index 9918127870..9918127870 100644
--- a/lib/active_relation/.DS_Store
+++ b/lib/arel/.DS_Store
Binary files differ
diff --git a/lib/arel/engines.rb b/lib/arel/engines.rb
new file mode 100644
index 0000000000..bb71537e9c
--- /dev/null
+++ b/lib/arel/engines.rb
@@ -0,0 +1 @@
+require 'arel/engines/engine' \ No newline at end of file
diff --git a/lib/active_relation/engines/engine.rb b/lib/arel/engines/engine.rb
index d5b312607e..b0b7b4e955 100644
--- a/lib/active_relation/engines/engine.rb
+++ b/lib/arel/engines/engine.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
# this file is currently just a hack to adapt between activerecord::base which holds the connection specification
# and active relation. ultimately, this file should be in effect what the connection specification is in active record;
# that is: a spec of the database (url, password, etc.), a quoting adapter layer, and a connection pool.
diff --git a/lib/arel/extensions.rb b/lib/arel/extensions.rb
new file mode 100644
index 0000000000..160cf36e5b
--- /dev/null
+++ b/lib/arel/extensions.rb
@@ -0,0 +1,6 @@
+require 'arel/extensions/object'
+require 'arel/extensions/class'
+require 'arel/extensions/array'
+require 'arel/extensions/hash'
+require 'arel/extensions/range'
+require 'arel/extensions/nil_class' \ No newline at end of file
diff --git a/lib/active_relation/extensions/array.rb b/lib/arel/extensions/array.rb
index 793c06aad8..793c06aad8 100644
--- a/lib/active_relation/extensions/array.rb
+++ b/lib/arel/extensions/array.rb
diff --git a/lib/active_relation/extensions/class.rb b/lib/arel/extensions/class.rb
index 0e5b728c26..0e5b728c26 100644
--- a/lib/active_relation/extensions/class.rb
+++ b/lib/arel/extensions/class.rb
diff --git a/lib/active_relation/extensions/hash.rb b/lib/arel/extensions/hash.rb
index 7472b5aa73..7472b5aa73 100644
--- a/lib/active_relation/extensions/hash.rb
+++ b/lib/arel/extensions/hash.rb
diff --git a/lib/active_relation/extensions/nil_class.rb b/lib/arel/extensions/nil_class.rb
index 729c4cada7..729c4cada7 100644
--- a/lib/active_relation/extensions/nil_class.rb
+++ b/lib/arel/extensions/nil_class.rb
diff --git a/lib/active_relation/extensions/object.rb b/lib/arel/extensions/object.rb
index 25cef989a4..779098f7ea 100644
--- a/lib/active_relation/extensions/object.rb
+++ b/lib/arel/extensions/object.rb
@@ -1,6 +1,6 @@
class Object
def bind(relation)
- ActiveRelation::Value.new(self, relation)
+ Arel::Value.new(self, relation)
end
def to_sql(formatter = nil)
diff --git a/lib/active_relation/extensions/range.rb b/lib/arel/extensions/range.rb
index d7329efe34..d7329efe34 100644
--- a/lib/active_relation/extensions/range.rb
+++ b/lib/arel/extensions/range.rb
diff --git a/lib/active_relation/predicates.rb b/lib/arel/predicates.rb
index 2cab1721d0..ccaec1ad93 100644
--- a/lib/active_relation/predicates.rb
+++ b/lib/arel/predicates.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Predicate
def ==(other)
self.class == other.class
diff --git a/lib/arel/primitives.rb b/lib/arel/primitives.rb
new file mode 100644
index 0000000000..d84713d3d5
--- /dev/null
+++ b/lib/arel/primitives.rb
@@ -0,0 +1,4 @@
+require 'arel/primitives/attribute'
+require 'arel/primitives/value'
+require 'arel/primitives/expression'
+
diff --git a/lib/active_relation/primitives/attribute.rb b/lib/arel/primitives/attribute.rb
index 5b1ef4d7c0..280fc9f439 100644
--- a/lib/active_relation/primitives/attribute.rb
+++ b/lib/arel/primitives/attribute.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Attribute
attr_reader :relation, :name, :alias, :ancestor
delegate :engine, :to => :relation
diff --git a/lib/active_relation/primitives/expression.rb b/lib/arel/primitives/expression.rb
index ae4c61d1b1..bf674cc9e1 100644
--- a/lib/active_relation/primitives/expression.rb
+++ b/lib/arel/primitives/expression.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Expression < Attribute
include Sql::Quoting
diff --git a/lib/active_relation/primitives/value.rb b/lib/arel/primitives/value.rb
index 9042aea067..650557559a 100644
--- a/lib/active_relation/primitives/value.rb
+++ b/lib/arel/primitives/value.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Value
attr_reader :value, :relation
diff --git a/lib/arel/relations.rb b/lib/arel/relations.rb
new file mode 100644
index 0000000000..96aa8e9d35
--- /dev/null
+++ b/lib/arel/relations.rb
@@ -0,0 +1,17 @@
+require 'arel/relations/relation'
+require 'arel/relations/nil'
+require 'arel/relations/compound'
+require 'arel/relations/writing'
+require 'arel/relations/table'
+require 'arel/relations/join'
+require 'arel/relations/grouping'
+require 'arel/relations/projection'
+require 'arel/relations/selection'
+require 'arel/relations/order'
+require 'arel/relations/take'
+require 'arel/relations/skip'
+require 'arel/relations/deletion'
+require 'arel/relations/insertion'
+require 'arel/relations/update'
+require 'arel/relations/alias'
+require 'arel/sessions/session' \ No newline at end of file
diff --git a/lib/active_relation/relations/alias.rb b/lib/arel/relations/alias.rb
index 4cb4913da5..2dab52515f 100644
--- a/lib/active_relation/relations/alias.rb
+++ b/lib/arel/relations/alias.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Alias < Compound
attr_reader :alias
diff --git a/lib/active_relation/relations/compound.rb b/lib/arel/relations/compound.rb
index 7c84482115..4ffac6d1c3 100644
--- a/lib/active_relation/relations/compound.rb
+++ b/lib/arel/relations/compound.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Compound < Relation
attr_reader :relation
diff --git a/lib/active_relation/relations/deletion.rb b/lib/arel/relations/deletion.rb
index f1d121d68f..6c802ba905 100644
--- a/lib/active_relation/relations/deletion.rb
+++ b/lib/arel/relations/deletion.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Deletion < Writing
def initialize(relation)
@relation = relation
diff --git a/lib/active_relation/relations/grouping.rb b/lib/arel/relations/grouping.rb
index 57323e90f3..ccca600360 100644
--- a/lib/active_relation/relations/grouping.rb
+++ b/lib/arel/relations/grouping.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Grouping < Compound
attr_reader :expressions, :groupings
diff --git a/lib/active_relation/relations/insertion.rb b/lib/arel/relations/insertion.rb
index 58defe4b01..37e7be8757 100644
--- a/lib/active_relation/relations/insertion.rb
+++ b/lib/arel/relations/insertion.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Insertion < Writing
attr_reader :record
diff --git a/lib/active_relation/relations/join.rb b/lib/arel/relations/join.rb
index a3e45f7f81..fb51ea0260 100644
--- a/lib/active_relation/relations/join.rb
+++ b/lib/arel/relations/join.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Join < Relation
attr_reader :join_sql, :relation1, :relation2, :predicates
diff --git a/lib/active_relation/relations/nil.rb b/lib/arel/relations/nil.rb
index 289ba834d8..3c1d413953 100644
--- a/lib/active_relation/relations/nil.rb
+++ b/lib/arel/relations/nil.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Nil < Relation
def table_sql; '' end
diff --git a/lib/active_relation/relations/order.rb b/lib/arel/relations/order.rb
index b5495fad67..91526da02c 100644
--- a/lib/active_relation/relations/order.rb
+++ b/lib/arel/relations/order.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Order < Compound
attr_reader :ordering
diff --git a/lib/active_relation/relations/projection.rb b/lib/arel/relations/projection.rb
index 0f8ea5175c..f09d4f894b 100644
--- a/lib/active_relation/relations/projection.rb
+++ b/lib/arel/relations/projection.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Projection < Compound
attr_reader :projections
diff --git a/lib/active_relation/relations/relation.rb b/lib/arel/relations/relation.rb
index 8ab266c53d..60fb7bd00a 100644
--- a/lib/active_relation/relations/relation.rb
+++ b/lib/arel/relations/relation.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Relation
def session
Session.new
diff --git a/lib/active_relation/relations/selection.rb b/lib/arel/relations/selection.rb
index fb90405b01..38a40e1b76 100644
--- a/lib/active_relation/relations/selection.rb
+++ b/lib/arel/relations/selection.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Selection < Compound
attr_reader :predicate
diff --git a/lib/active_relation/relations/skip.rb b/lib/arel/relations/skip.rb
index 5973dff8b9..f17e439ebf 100644
--- a/lib/active_relation/relations/skip.rb
+++ b/lib/arel/relations/skip.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Skip < Compound
attr_reader :skipped
diff --git a/lib/active_relation/relations/table.rb b/lib/arel/relations/table.rb
index e645f71030..cdc03df623 100644
--- a/lib/active_relation/relations/table.rb
+++ b/lib/arel/relations/table.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Table < Relation
cattr_accessor :engine
attr_reader :name, :engine
diff --git a/lib/active_relation/relations/take.rb b/lib/arel/relations/take.rb
index d9d439b3f5..d2743d7a6e 100644
--- a/lib/active_relation/relations/take.rb
+++ b/lib/arel/relations/take.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Take < Compound
attr_reader :taken
diff --git a/lib/active_relation/relations/update.rb b/lib/arel/relations/update.rb
index 6262ead187..f1f6776f15 100644
--- a/lib/active_relation/relations/update.rb
+++ b/lib/arel/relations/update.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Update < Writing
attr_reader :assignments
diff --git a/lib/active_relation/relations/writing.rb b/lib/arel/relations/writing.rb
index 2714ce4d0c..b871e5a520 100644
--- a/lib/active_relation/relations/writing.rb
+++ b/lib/arel/relations/writing.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
class Writing < Compound
end
end \ No newline at end of file
diff --git a/lib/active_relation/sessions/session.rb b/lib/arel/sessions/session.rb
index fe917a0e4d..becf23b8b6 100644
--- a/lib/active_relation/sessions/session.rb
+++ b/lib/arel/sessions/session.rb
@@ -1,6 +1,6 @@
require 'singleton'
-module ActiveRelation
+module Arel
class Session
class << self
attr_accessor :instance
diff --git a/lib/active_relation/sql.rb b/lib/arel/sql.rb
index 0b9b0fc18b..b6d646c047 100644
--- a/lib/active_relation/sql.rb
+++ b/lib/arel/sql.rb
@@ -1,4 +1,4 @@
-module ActiveRelation
+module Arel
module Sql
module Quoting
delegate :quote_table_name, :quote_column_name, :quote, :to => :engine
diff --git a/spec/active_relation/unit/predicates/binary_spec.rb b/spec/arel/unit/predicates/binary_spec.rb
index 56c568b078..f39b37d913 100644
--- a/spec/active_relation/unit/predicates/binary_spec.rb
+++ b/spec/arel/unit/predicates/binary_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Binary do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/predicates/equality_spec.rb b/spec/arel/unit/predicates/equality_spec.rb
index 5415b35925..8a58ba3096 100644
--- a/spec/active_relation/unit/predicates/equality_spec.rb
+++ b/spec/arel/unit/predicates/equality_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Equality do
before do
@relation1 = Table.new(:users)
diff --git a/spec/active_relation/unit/predicates/in_spec.rb b/spec/arel/unit/predicates/in_spec.rb
index 4ca7867dd0..797798a77f 100644
--- a/spec/active_relation/unit/predicates/in_spec.rb
+++ b/spec/arel/unit/predicates/in_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe In do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/primitives/attribute_spec.rb b/spec/arel/unit/primitives/attribute_spec.rb
index 471ae91b5b..ac9afa85c7 100644
--- a/spec/active_relation/unit/primitives/attribute_spec.rb
+++ b/spec/arel/unit/primitives/attribute_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Attribute do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/primitives/expression_spec.rb b/spec/arel/unit/primitives/expression_spec.rb
index c15b073ba3..8a990231f6 100644
--- a/spec/active_relation/unit/primitives/expression_spec.rb
+++ b/spec/arel/unit/primitives/expression_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Expression do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/primitives/value_spec.rb b/spec/arel/unit/primitives/value_spec.rb
index ab632ef987..87425c780d 100644
--- a/spec/active_relation/unit/primitives/value_spec.rb
+++ b/spec/arel/unit/primitives/value_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Value do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/alias_spec.rb b/spec/arel/unit/relations/alias_spec.rb
index 4a2144db82..420a91c806 100644
--- a/spec/active_relation/unit/relations/alias_spec.rb
+++ b/spec/arel/unit/relations/alias_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Alias do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/compound_spec.rb b/spec/arel/unit/relations/compound_spec.rb
index 54a89f3f57..763e447db3 100644
--- a/spec/active_relation/unit/relations/compound_spec.rb
+++ b/spec/arel/unit/relations/compound_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Compound do
before do
class ConcreteCompound < Compound
diff --git a/spec/active_relation/unit/relations/deletion_spec.rb b/spec/arel/unit/relations/deletion_spec.rb
index 08f7bc03bb..f975720d83 100644
--- a/spec/active_relation/unit/relations/deletion_spec.rb
+++ b/spec/arel/unit/relations/deletion_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Deletion do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/grouping_spec.rb b/spec/arel/unit/relations/grouping_spec.rb
index 4b5badbb8b..bef3566896 100644
--- a/spec/active_relation/unit/relations/grouping_spec.rb
+++ b/spec/arel/unit/relations/grouping_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Grouping do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/insertion_spec.rb b/spec/arel/unit/relations/insertion_spec.rb
index 543e2d51a9..10b70a2036 100644
--- a/spec/active_relation/unit/relations/insertion_spec.rb
+++ b/spec/arel/unit/relations/insertion_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Insertion do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/join_spec.rb b/spec/arel/unit/relations/join_spec.rb
index c1a13cee6e..f9d0d9561e 100644
--- a/spec/active_relation/unit/relations/join_spec.rb
+++ b/spec/arel/unit/relations/join_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Join do
before do
@relation1 = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/order_spec.rb b/spec/arel/unit/relations/order_spec.rb
index e8a2f4c227..838a2f141e 100644
--- a/spec/active_relation/unit/relations/order_spec.rb
+++ b/spec/arel/unit/relations/order_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Order do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/projection_spec.rb b/spec/arel/unit/relations/projection_spec.rb
index 5936cbc45f..cd59d6c383 100644
--- a/spec/active_relation/unit/relations/projection_spec.rb
+++ b/spec/arel/unit/relations/projection_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Projection do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/relation_spec.rb b/spec/arel/unit/relations/relation_spec.rb
index c40974e136..46c3ee250d 100644
--- a/spec/active_relation/unit/relations/relation_spec.rb
+++ b/spec/arel/unit/relations/relation_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Relation do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/selection_spec.rb b/spec/arel/unit/relations/selection_spec.rb
index d87e075f98..61d9787df2 100644
--- a/spec/active_relation/unit/relations/selection_spec.rb
+++ b/spec/arel/unit/relations/selection_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Selection do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/skip_spec.rb b/spec/arel/unit/relations/skip_spec.rb
index 219bfdd80e..d83c969aa8 100644
--- a/spec/active_relation/unit/relations/skip_spec.rb
+++ b/spec/arel/unit/relations/skip_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Skip do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/table_spec.rb b/spec/arel/unit/relations/table_spec.rb
index 2751d9cb63..eb765ce777 100644
--- a/spec/active_relation/unit/relations/table_spec.rb
+++ b/spec/arel/unit/relations/table_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Table do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/take_spec.rb b/spec/arel/unit/relations/take_spec.rb
index 8c13732258..dca7806057 100644
--- a/spec/active_relation/unit/relations/take_spec.rb
+++ b/spec/arel/unit/relations/take_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Take do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/relations/update_spec.rb b/spec/arel/unit/relations/update_spec.rb
index 29dd4e12dd..f411781392 100644
--- a/spec/active_relation/unit/relations/update_spec.rb
+++ b/spec/arel/unit/relations/update_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Update do
before do
@relation = Table.new(:users)
diff --git a/spec/active_relation/unit/session/session_spec.rb b/spec/arel/unit/session/session_spec.rb
index 5c3b668e1f..c2eb9a4555 100644
--- a/spec/active_relation/unit/session/session_spec.rb
+++ b/spec/arel/unit/session/session_spec.rb
@@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
-module ActiveRelation
+module Arel
describe Session do
before do
@relation = Table.new(:users)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6180f822bd..bc117ec47d 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -5,7 +5,7 @@ require 'rubygems'
require 'spec'
require 'pp'
require 'fileutils'
-require 'active_relation'
+require 'arel'
[:matchers, :doubles].each do |helper|
Dir["#{dir}/#{helper}/*"].each { |m| require "#{dir}/#{helper}/#{File.basename(m)}" }
@@ -15,6 +15,6 @@ Spec::Runner.configure do |config|
config.include(BeLikeMatcher, HashTheSameAsMatcher)
config.mock_with :rr
config.before do
- ActiveRelation::Table.engine = ActiveRelation::Engine.new(Fake::Engine.new)
+ Arel::Table.engine = Arel::Engine.new(Fake::Engine.new)
end
end \ No newline at end of file