Skip to content

Commit f2496f1

Browse files
authored
Merge pull request #1 from kickstarter/testBranch
Merging test branch
2 parents b5fb6e2 + 8c05de0 commit f2496f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/replicate/active_record.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,11 @@ def replicate_find_existing_record(attributes)
269269
replicate_natural_key.each do |attribute_name|
270270
conditions[attribute_name] = attributes[attribute_name.to_s]
271271
end
272-
find(:first, :conditions => conditions)
272+
if ::ActiveRecord::VERSION::MAJOR >= 4
273+
where(conditions).first
274+
else
275+
find(:first, :conditions => conditions)
276+
end
273277
end
274278

275279
# Update an AR object's attributes and persist to the database without

0 commit comments

Comments
 (0)