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:
parent
518db17ca3
commit
e8966bf9a8
25 changed files with 27 additions and 57 deletions
|
@ -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'
|
|
@ -1 +0,0 @@
|
|||
require 'arel/engines/engine'
|
|
@ -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'
|
8
lib/arel/relations/operations.rb
Normal file
8
lib/arel/relations/operations.rb
Normal 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'
|
5
lib/arel/relations/utilities.rb
Normal file
5
lib/arel/relations/utilities.rb
Normal 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'
|
3
lib/arel/relations/writes.rb
Normal file
3
lib/arel/relations/writes.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
require 'arel/relations/writes/delete'
|
||||
require 'arel/relations/writes/update'
|
||||
require 'arel/relations/writes/insert'
|
|
@ -1,5 +1,5 @@
|
|||
module Arel
|
||||
class Deletion < Writing
|
||||
class Deletion < Compound
|
||||
def initialize(relation)
|
||||
@relation = relation
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
module Arel
|
||||
class Insert < Writing
|
||||
class Insert < Compound
|
||||
attr_reader :record
|
||||
|
||||
def initialize(relation, record)
|
|
@ -1,5 +1,5 @@
|
|||
module Arel
|
||||
class Update < Writing
|
||||
class Update < Compound
|
||||
attr_reader :assignments
|
||||
|
||||
def initialize(relation, assignments)
|
|
@ -1,4 +0,0 @@
|
|||
module Arel
|
||||
class Writing < Compound
|
||||
end
|
||||
end
|
|
@ -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
|
Loading…
Reference in a new issue