mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert "Table#[] returns nil when table does not exist"
This reverts commit e460aa96ae
.
This commit is contained in:
parent
e460aa96ae
commit
f95f0918d7
2 changed files with 0 additions and 9 deletions
|
@ -88,8 +88,6 @@ module Arel
|
||||||
end
|
end
|
||||||
|
|
||||||
def [] name
|
def [] name
|
||||||
return nil unless @engine.connection.table_exists?(@name)
|
|
||||||
|
|
||||||
name = name.to_sym
|
name = name.to_sym
|
||||||
columns.find { |column| column.name == name }
|
columns.find { |column| column.name == name }
|
||||||
end
|
end
|
||||||
|
|
|
@ -147,13 +147,6 @@ module Arel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when table does not exist' do
|
|
||||||
it 'returns nil' do
|
|
||||||
table = Table.new(:foooo)
|
|
||||||
table[:id].should be_nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
### FIXME: this seems like a bad requirement.
|
### FIXME: this seems like a bad requirement.
|
||||||
#describe 'when given an', Attribute do
|
#describe 'when given an', Attribute do
|
||||||
# it "returns the attribute if the attribute is within the relation" do
|
# it "returns the attribute if the attribute is within the relation" do
|
||||||
|
|
Loading…
Reference in a new issue