Skip to content

Commit

Permalink
Stripped whitespace with sake strip
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Kubb committed Sep 12, 2008
1 parent 8ec812f commit 0ac6b42
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion lib/dm-core/adapters/data_objects_adapter.rb
Expand Up @@ -328,7 +328,7 @@ def condition_statement(query, operator, left_condition, right_condition)
opposite = condition == left_condition ? right_condition : left_condition
query.merge_subquery(operator, opposite, condition)
"(#{read_statement(condition)})"

# [].all? is always true
elsif condition.kind_of?(Array) && condition.any? && condition.all? { |p| p.kind_of?(Property) }
property_values = condition.map { |p| property_to_column_name(query.repository, p, qualify) }
Expand Down
4 changes: 2 additions & 2 deletions lib/dm-core/property.rb
Expand Up @@ -393,7 +393,7 @@ def get(resource)

set_original_value(resource, value)

# [YK] Why did we previously care whether options[:default] is nil.
# [YK] Why did we previously care whether options[:default] is nil.
# The default value of nil will be applied either way
if value.nil? && resource.new_record? && !resource.attribute_loaded?(name)
value = default_for(resource)
Expand Down Expand Up @@ -422,7 +422,7 @@ def set_original_value(resource, val)
# @api private
def set(resource, value)
# [YK] We previously checked for new_record? here, but lazy loading
# is blocked anyway if we're in a new record by by
# is blocked anyway if we're in a new record by by
# Resource#reload_attributes. This may eventually be useful for
# optimizing, but let's (a) benchmark it first, and (b) do
# whatever refactoring is necessary, which will benefit from the
Expand Down
2 changes: 1 addition & 1 deletion lib/dm-core/query.rb
Expand Up @@ -439,7 +439,7 @@ def dump_custom_value(property_or_path, bind_value)
dump_custom_value(property_or_path.property, bind_value)
when Property
if property_or_path.custom?
property_or_path.type.dump(bind_value, property_or_path)
property_or_path.type.dump(bind_value, property_or_path)
else
bind_value
end
Expand Down
2 changes: 1 addition & 1 deletion lib/dm-core/resource.rb
Expand Up @@ -575,7 +575,7 @@ def initialize(attributes = {}) # :nodoc:
assert_valid_model
self.attributes = attributes
end

def assert_valid_model # :nodoc:
return if self.class._valid_model
properties = self.properties
Expand Down
8 changes: 4 additions & 4 deletions spec/integration/association_spec.rb
Expand Up @@ -376,7 +376,7 @@ class Ostrich

y.machine.name.should == 'machine10'
end

it 'should convert NULL parent ids into nils' do
Area.first(:name => 'area2').machine.should be_nil
end
Expand Down Expand Up @@ -570,13 +570,13 @@ class Ostrich
end
machine.areas.size.should == 4
end

it "#build should add exactly one instance of the built record" do
machine = Machine.create(:name => 'my machine')

original_size = machine.areas.size
machine.areas.build(:name => "an area", :machine => machine)

machine.areas.size.should == original_size + 1
end

Expand Down
6 changes: 3 additions & 3 deletions spec/integration/query_spec.rb
Expand Up @@ -268,20 +268,20 @@ class << operator
find.should have(0).entries
end
end

it "should work when id is NOT an empty Array" do
repository(ADAPTER) do
find = QuerySpec::SailBoat.all(:id.not => [])
find.should have(3).entries
end
end

it "should work when id is an empty Array and other conditions are specified" do
repository(ADAPTER) do
find = QuerySpec::SailBoat.all(:id => [], :name => "A")
find.should have(0).entries
end
end
end

it "should work when id is NOT an empty Array and other conditions are specified" do
repository(ADAPTER) do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/repository_spec.rb
Expand Up @@ -42,7 +42,7 @@ class SerialFinderSpec
sfs = @repository.read_one(@query.merge(:fields => [ :id ], :limit => 1))
sfs.should be_a_kind_of(@model)
sfs.should_not be_a_new_record

sfs.attribute_loaded?(:sample).should be_false
sfs.sample.should_not be_nil
end
Expand Down

0 comments on commit 0ac6b42

Please sign in to comment.