Permalink
Browse files

Merge pull request #10745 from arunagw/build_fix_ruby187

Build fix ruby187
  • Loading branch information...
pixeltrix committed May 24, 2013
2 parents d293990 + 0e14973 commit 7101a857b46e1c8aa3b9dd9641c4fc5b28a143e6
@@ -89,7 +89,7 @@ def delete_records(records, method)
records.each { |r| r.destroy }
update_counter(-records.length) unless inverse_updates_counter_cache?
else
- scope = self.scope.where(reflection.klass.primary_key => records)
+ scope = self.scoped.where(reflection.klass.primary_key => records)
if method == :delete_all
update_counter(-scope.delete_all)
@@ -1496,7 +1496,7 @@ def test_has_many_assignment_with_custom_primary_key
david = people(:david)
assert_equal ["A Modest Proposal"], david.essays.map(&:name)
- david.essays = [Essay.create!(name: "Remote Work" )]
+ david.essays = [Essay.create!(:name => "Remote Work" )]
assert_equal ["Remote Work"], david.essays.map(&:name)
end
@@ -781,17 +781,17 @@ def test_when_new_record_a_child_marked_for_destruction_should_not_affect_other_
end
def test_should_save_new_record_that_has_same_value_as_existing_record_marked_for_destruction_on_field_that_has_unique_index
- Bird.connection.add_index :birds, :name, unique: true
+ Bird.connection.add_index :birds, :name, :unique => true
- 3.times { |i| @pirate.birds.create(name: "unique_birds_#{i}") }
+ 3.times { |i| @pirate.birds.create(:name => "unique_birds_#{i}") }
@pirate.birds[0].mark_for_destruction
- @pirate.birds.build(name: @pirate.birds[0].name)
+ @pirate.birds.build(:name => @pirate.birds[0].name)
@pirate.save!
assert_equal 3, @pirate.birds.reload.length
ensure
- Bird.connection.remove_index :birds, column: :name
+ Bird.connection.remove_index :birds, :column => :name
end
# Add and remove callbacks tests for association collections.
@@ -27,7 +27,7 @@ class Person < ActiveRecord::Base
has_many :agents_posts, :through => :agents, :source => :posts
has_many :agents_posts_authors, :through => :agents_posts, :source => :author
- has_many :essays, primary_key: "first_name", foreign_key: "writer_id"
+ has_many :essays, :primary_key => "first_name", :foreign_key => "writer_id"
scope :males, :conditions => { :gender => 'M' }
scope :females, :conditions => { :gender => 'F' }

0 comments on commit 7101a85

Please sign in to comment.