aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--History.txt6
-rw-r--r--README.markdown6
-rw-r--r--arel.gemspec12
-rw-r--r--lib/arel.rb2
-rw-r--r--lib/arel/crud.rb6
-rw-r--r--lib/arel/select_manager.rb4
-rw-r--r--lib/arel/table.rb2
-rw-r--r--lib/arel/visitors/dot.rb2
-rw-r--r--lib/arel/visitors/oracle.rb3
-rw-r--r--lib/arel/visitors/to_sql.rb8
-rw-r--r--test/support/fake_record.rb6
-rw-r--r--test/visitors/test_oracle.rb3
12 files changed, 33 insertions, 27 deletions
diff --git a/History.txt b/History.txt
index 66e2c73be7..b24faf3267 100644
--- a/History.txt
+++ b/History.txt
@@ -144,7 +144,7 @@
* Deprecations
- * Support for Subclasses of core classes will be removed in ARel version
+ * Support for Subclasses of core classes will be removed in Arel version
2.2.0
== 2.0.4
@@ -184,7 +184,7 @@
* Introduced "SQL compilers" for query generation.
* Added support for Oracle (Raimonds Simanovskis) and IBM/DB (Praveen Devarao).
- * Improvements to give better support to ActiveRecord.
+ * Improvements to give better support to Active Record.
== 0.2.1 / 2010-02-05
@@ -195,7 +195,7 @@
== 0.2.0 / 2010-01-31
* Ruby 1.9 compatibility
- * Many improvements to support the Arel integration into ActiveRecord (see `git log v0.1.0..v0.2.0`)
+ * Many improvements to support the Arel integration into Active Record (see `git log v0.1.0..v0.2.0`)
* Thanks to Emilio Tagua and Pratik Naik for many significant contributions!
== 0.1.0 / 2009-08-06
diff --git a/README.markdown b/README.markdown
index 89a422d15f..76fe730294 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1,4 +1,4 @@
-# ARel [![Build Status](https://secure.travis-ci.org/rails/arel.png)](http://travis-ci.org/rails/arel) [![Dependency Status](https://gemnasium.com/rails/arel.png)](https://gemnasium.com/rails/arel)
+# Arel [![Build Status](https://secure.travis-ci.org/rails/arel.png)](http://travis-ci.org/rails/arel) [![Dependency Status](https://gemnasium.com/rails/arel.png)](https://gemnasium.com/rails/arel)
* http://github.com/rails/arel
@@ -15,11 +15,11 @@ database compatibility and query generation.
## Status
-For the moment, Arel uses ActiveRecord's connection adapters to connect to the various engines, connection pooling, perform quoting, and do type conversion.
+For the moment, Arel uses Active Record's connection adapters to connect to the various engines, connection pooling, perform quoting, and do type conversion.
## A Gentle Introduction
-Generating a query with ARel is simple. For example, in order to produce
+Generating a query with Arel is simple. For example, in order to produce
SELECT * FROM users
diff --git a/arel.gemspec b/arel.gemspec
index 1d2544254d..7cd92e1561 100644
--- a/arel.gemspec
+++ b/arel.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = "arel"
- s.version = "4.0.0.beta1.20130225132415"
+ s.version = "4.0.0.beta2.20130314230643"
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Aaron Patterson", "Bryan Halmkamp", "Emilio Tagua", "Nick Kallen"]
- s.date = "2013-02-25"
+ s.date = "2013-03-15"
s.description = "Arel is a SQL AST manager for Ruby. It\n\n1. Simplifies the generation of complex SQL queries\n2. Adapts to various RDBMS systems\n\nIt is intended to be a framework framework; that is, you can build your own ORM\nwith it, focusing on innovative object and collection modeling as opposed to\ndatabase compatibility and query generation."
s.email = ["aaron@tenderlovemaking.com", "bryan@brynary.com", "miloops@gmail.com", "nick@example.org"]
s.extra_rdoc_files = ["History.txt", "MIT-LICENSE.txt", "Manifest.txt", "README.markdown"]
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--main", "README.markdown"]
s.require_paths = ["lib"]
s.rubyforge_project = "arel"
- s.rubygems_version = "2.0.0"
+ s.rubygems_version = "2.0.2"
s.summary = "Arel is a SQL AST manager for Ruby"
s.test_files = ["test/attributes/test_attribute.rb", "test/nodes/test_and.rb", "test/nodes/test_as.rb", "test/nodes/test_ascending.rb", "test/nodes/test_bin.rb", "test/nodes/test_count.rb", "test/nodes/test_delete_statement.rb", "test/nodes/test_descending.rb", "test/nodes/test_distinct.rb", "test/nodes/test_equality.rb", "test/nodes/test_extract.rb", "test/nodes/test_false.rb", "test/nodes/test_grouping.rb", "test/nodes/test_infix_operation.rb", "test/nodes/test_insert_statement.rb", "test/nodes/test_named_function.rb", "test/nodes/test_node.rb", "test/nodes/test_not.rb", "test/nodes/test_or.rb", "test/nodes/test_over.rb", "test/nodes/test_select_core.rb", "test/nodes/test_select_statement.rb", "test/nodes/test_sql_literal.rb", "test/nodes/test_sum.rb", "test/nodes/test_table_alias.rb", "test/nodes/test_true.rb", "test/nodes/test_update_statement.rb", "test/nodes/test_window.rb", "test/test_activerecord_compat.rb", "test/test_attributes.rb", "test/test_crud.rb", "test/test_delete_manager.rb", "test/test_factory_methods.rb", "test/test_insert_manager.rb", "test/test_select_manager.rb", "test/test_table.rb", "test/test_update_manager.rb", "test/visitors/test_bind_visitor.rb", "test/visitors/test_depth_first.rb", "test/visitors/test_dot.rb", "test/visitors/test_ibm_db.rb", "test/visitors/test_informix.rb", "test/visitors/test_join_sql.rb", "test/visitors/test_mssql.rb", "test/visitors/test_mysql.rb", "test/visitors/test_oracle.rb", "test/visitors/test_postgres.rb", "test/visitors/test_sqlite.rb", "test/visitors/test_to_sql.rb"]
@@ -24,16 +24,16 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency(%q<minitest>, ["~> 4.6"])
- s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
+ s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
s.add_development_dependency(%q<hoe>, ["~> 3.5"])
else
s.add_dependency(%q<minitest>, ["~> 4.6"])
- s.add_dependency(%q<rdoc>, ["~> 4.0"])
+ s.add_dependency(%q<rdoc>, ["~> 3.10"])
s.add_dependency(%q<hoe>, ["~> 3.5"])
end
else
s.add_dependency(%q<minitest>, ["~> 4.6"])
- s.add_dependency(%q<rdoc>, ["~> 4.0"])
+ s.add_dependency(%q<rdoc>, ["~> 3.10"])
s.add_dependency(%q<hoe>, ["~> 3.5"])
end
end
diff --git a/lib/arel.rb b/lib/arel.rb
index 1777e10390..df7daf5d57 100644
--- a/lib/arel.rb
+++ b/lib/arel.rb
@@ -32,7 +32,7 @@ require 'arel/sql_literal'
####
module Arel
- VERSION = '4.0.0.beta1'
+ VERSION = '4.0.0.beta2'
def self.sql raw_sql
Arel::Nodes::SqlLiteral.new raw_sql
diff --git a/lib/arel/crud.rb b/lib/arel/crud.rb
index 6c29d5fee4..e8e78a381c 100644
--- a/lib/arel/crud.rb
+++ b/lib/arel/crud.rb
@@ -22,7 +22,7 @@ module Arel
def update values
if $VERBOSE
warn <<-eowarn
-update (#{caller.first}) is deprecated and will be removed in ARel 4.0.0. Please
+update (#{caller.first}) is deprecated and will be removed in Arel 4.0.0. Please
switch to `compile_update`
eowarn
end
@@ -45,7 +45,7 @@ switch to `compile_update`
def insert values
if $VERBOSE
warn <<-eowarn
-insert (#{caller.first}) is deprecated and will be removed in ARel 4.0.0. Please
+insert (#{caller.first}) is deprecated and will be removed in Arel 4.0.0. Please
switch to `compile_insert`
eowarn
end
@@ -62,7 +62,7 @@ switch to `compile_insert`
def delete
if $VERBOSE
warn <<-eowarn
-delete (#{caller.first}) is deprecated and will be removed in ARel 4.0.0. Please
+delete (#{caller.first}) is deprecated and will be removed in Arel 4.0.0. Please
switch to `compile_delete`
eowarn
end
diff --git a/lib/arel/select_manager.rb b/lib/arel/select_manager.rb
index b5c5834a51..ee9d34a514 100644
--- a/lib/arel/select_manager.rb
+++ b/lib/arel/select_manager.rb
@@ -170,7 +170,7 @@ module Arel
end
def wheres
- warn "#{caller[0]}: SelectManager#wheres is deprecated and will be removed in ARel 4.0.0 with no replacement"
+ warn "#{caller[0]}: SelectManager#wheres is deprecated and will be removed in Arel 4.0.0 with no replacement"
Compatibility::Wheres.new @engine.connection, @ctx.wheres
end
@@ -276,7 +276,7 @@ module Arel
def insert values
if $VERBOSE
warn <<-eowarn
-insert (#{caller.first}) is deprecated and will be removed in ARel 4.0.0. Please
+insert (#{caller.first}) is deprecated and will be removed in Arel 4.0.0. Please
switch to `compile_insert`
eowarn
end
diff --git a/lib/arel/table.rb b/lib/arel/table.rb
index 6f1ab7e90f..5fb1254d17 100644
--- a/lib/arel/table.rb
+++ b/lib/arel/table.rb
@@ -32,7 +32,7 @@ module Arel
def primary_key
if $VERBOSE
warn <<-eowarn
-primary_key (#{caller.first}) is deprecated and will be removed in ARel 4.0.0
+primary_key (#{caller.first}) is deprecated and will be removed in Arel 4.0.0
eowarn
end
@primary_key ||= begin
diff --git a/lib/arel/visitors/dot.rb b/lib/arel/visitors/dot.rb
index e309bd6f12..843266f85a 100644
--- a/lib/arel/visitors/dot.rb
+++ b/lib/arel/visitors/dot.rb
@@ -254,7 +254,7 @@ module Arel
end
def to_dot
- "digraph \"ARel\" {\nnode [width=0.375,height=0.25,shape=record];\n" +
+ "digraph \"Arel\" {\nnode [width=0.375,height=0.25,shape=record];\n" +
@nodes.map { |node|
label = "<f0>#{node.name}"
diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb
index 6a58a3cff2..375f7dbfe9 100644
--- a/lib/arel/visitors/oracle.rb
+++ b/lib/arel/visitors/oracle.rb
@@ -25,8 +25,9 @@ module Arel
SELECT * FROM (
SELECT raw_sql_.*, rownum raw_rnum_
FROM (#{sql}) raw_sql_
+ WHERE rownum <= #{offset.expr.to_i + limit}
)
- WHERE raw_rnum_ >= #{offset.expr.to_i + 1 } and rownum <= #{limit}
+ WHERE #{visit offset}
eosql
end
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb
index 050a9b2e63..1a4826bcd2 100644
--- a/lib/arel/visitors/to_sql.rb
+++ b/lib/arel/visitors/to_sql.rb
@@ -96,7 +96,7 @@ module Arel
unless key
warn(<<-eowarn) if $VERBOSE
(#{caller.first}) Using UpdateManager without setting UpdateManager#key is
-deprecated and support will be removed in ARel 4.0.0. Please set the primary
+deprecated and support will be removed in Arel 4.0.0. Please set the primary
key on UpdateManager using UpdateManager#key=
eowarn
key = o.relation.primary_key
@@ -147,11 +147,11 @@ key on UpdateManager using UpdateManager#key=
return nil unless table_exists? table
- column_cache[table][name]
+ column_cache(table)[name]
end
- def column_cache
- @schema_cache.columns_hash
+ def column_cache(table)
+ @schema_cache.columns_hash(table)
end
def visit_Arel_Nodes_Values o
diff --git a/test/support/fake_record.rb b/test/support/fake_record.rb
index 79182f86bd..58883e43cd 100644
--- a/test/support/fake_record.rb
+++ b/test/support/fake_record.rb
@@ -3,7 +3,7 @@ module FakeRecord
end
class Connection
- attr_reader :tables, :columns_hash
+ attr_reader :tables
attr_accessor :visitor
def initialize(visitor = nil)
@@ -31,6 +31,10 @@ module FakeRecord
@visitor = visitor
end
+ def columns_hash table_name
+ @columns_hash[table_name]
+ end
+
def primary_key name
@primary_keys[name.to_s]
end
diff --git a/test/visitors/test_oracle.rb b/test/visitors/test_oracle.rb
index 42bfaadf8a..421e9951e6 100644
--- a/test/visitors/test_oracle.rb
+++ b/test/visitors/test_oracle.rb
@@ -102,8 +102,9 @@ module Arel
SELECT * FROM (
SELECT raw_sql_.*, rownum raw_rnum_
FROM (SELECT) raw_sql_
+ WHERE rownum <= 20
)
- WHERE raw_rnum_ >= 11 and rownum <= 10
+ WHERE raw_rnum_ > 10
}
end