aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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
40 files changed, 64 insertions, 64 deletions
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