Skip to content
Browse files

cleanup `reload_with_master` implementation

  • Loading branch information...
1 parent cc319af commit db3d30419684581b6e40fdb514231376ce8b8cb7 @mislav committed Apr 12, 2009
Showing with 5 additions and 7 deletions.
  1. +5 −7 lib/active_reload/connection_proxy.rb
View
12 lib/active_reload/connection_proxy.rb
@@ -144,13 +144,11 @@ def connection
end
end
end
-
- def reload_with_master(*args, &block)
- if connection.class.name == "ActiveReload::ConnectionProxy"
- connection.with_master { reload_without_master }
- else
- reload_without_master
- end
+
+ # reload performs a find, but is usually used after a write, so we lock it
+ # to master since we can't depend on slave replication being so fast
+ def reload_with_master(options = nil)
+ connection.with_master { reload_without_master(options) }
end
end

0 comments on commit db3d304

Please sign in to comment.
Something went wrong with that request. Please try again.