spec/apps/kitchen_sink/app/main/models/user.rb in volt-0.9.6.pre2 vs spec/apps/kitchen_sink/app/main/models/user.rb in volt-0.9.6.pre3
- old
+ new
@@ -6,22 +6,22 @@
validate login_field, unique: true, length: 8
validate :email, email: true
unless RUBY_PLATFORM == "opal"
- Volt.current_app.on("user_connect") do |user_id|
- begin
- Volt.current_app.store.users.where(id: user_id).first.sync._event_triggered = "user_connect"
- rescue
- #we rescue as this callback will also get called from the SocketConnectionHandler specs (and will fail)
- end
- end
+ Volt.current_app.on("user_connect") do |user_id|
+ begin
+ Volt.current_app.store.users.where(id: user_id).first.sync._event_triggered = "user_connect"
+ rescue
+ #we rescue as this callback will also get called from the SocketConnectionHandler specs (and will fail)
+ end
+ end
- Volt.current_app.on("user_disconnect") do |user_id|
- begin
- Volt.current_app.store.users.where(id: user_id).first.sync._event_triggered = "user_disconnect"
- rescue
- #we rescue as this callback will also get called from the SocketConnectionHandler specs (and will fail)
- end
- end
+ Volt.current_app.on("user_disconnect") do |user_id|
+ begin
+ user = Volt.current_app.store.users.where(id: user_id).first.sync._event_triggered = "user_disconnect"
+ rescue => e
+ #we rescue as this callback will also get called from the SocketConnectionHandler specs (and will fail)
+ end
+ end
end
end