1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

reorganized file structure

This commit is contained in:
Nick Kallen 2008-05-19 14:08:42 -07:00
parent 518db17ca3
commit e8966bf9a8
25 changed files with 27 additions and 57 deletions

View file

@ -8,5 +8,6 @@ require 'arel/extensions'
require 'arel/sql'
require 'arel/predicates'
require 'arel/relations'
require 'arel/engines'
require 'arel/engine'
require 'arel/session'
require 'arel/primitives'

View file

@ -1 +0,0 @@
require 'arel/engines/engine'

View file

@ -1,19 +1,8 @@
require 'arel/relations/recursion'
require 'arel/relations/relation'
require 'arel/relations/nil'
require 'arel/relations/compound'
require 'arel/relations/writing'
require 'arel/relations/utilities'
require 'arel/relations/table'
require 'arel/relations/aggregation'
require 'arel/relations/join'
require 'arel/relations/group'
require 'arel/relations/project'
require 'arel/relations/where'
require 'arel/relations/order'
require 'arel/relations/take'
require 'arel/relations/skip'
require 'arel/relations/delete'
require 'arel/relations/insert'
require 'arel/relations/update'
require 'arel/relations/alias'
require 'arel/sessions/session'
require 'arel/relations/writes'
require 'arel/relations/operations'

View file

@ -0,0 +1,8 @@
require 'arel/relations/operations/alias'
require 'arel/relations/operations/group'
require 'arel/relations/operations/join'
require 'arel/relations/operations/order'
require 'arel/relations/operations/project'
require 'arel/relations/operations/where'
require 'arel/relations/operations/skip'
require 'arel/relations/operations/take'

View file

@ -0,0 +1,5 @@
require 'arel/relations/utilities/compound'
require 'arel/relations/utilities/recursion'
require 'arel/relations/utilities/nil'
require 'arel/relations/utilities/aggregation'
require 'arel/relations/utilities/recursion'

View file

@ -0,0 +1,3 @@
require 'arel/relations/writes/delete'
require 'arel/relations/writes/update'
require 'arel/relations/writes/insert'

View file

@ -1,5 +1,5 @@
module Arel
class Deletion < Writing
class Deletion < Compound
def initialize(relation)
@relation = relation
end

View file

@ -1,5 +1,5 @@
module Arel
class Insert < Writing
class Insert < Compound
attr_reader :record
def initialize(relation, record)

View file

@ -1,5 +1,5 @@
module Arel
class Update < Writing
class Update < Compound
attr_reader :assignments
def initialize(relation, assignments)

View file

@ -1,4 +0,0 @@
module Arel
class Writing < Compound
end
end

View file

@ -1,31 +0,0 @@
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
module Arel
describe Compound do
before do
class ConcreteCompound < Compound
def initialize(relation)
@relation = relation
end
def ==(other)
true
end
end
@relation = Table.new(:users)
@compound_relation = ConcreteCompound.new(@relation)
end
describe '#attributes' do
it 'manufactures attributes associated with the compound relation' do
@compound_relation.attributes.should == @relation.attributes.collect { |a| a.bind(@compound_relation) }
end
end
describe 'hashing' do
it 'implements hash equality' do
ConcreteCompound.new(@relation).should hash_the_same_as(ConcreteCompound.new(@relation))
end
end
end
end