0

I found a code in stackoverflow.

def after_sign_up_or_signin_path_for(resource)  
  resource.update_all(online: true)  
  dashboard_url
end  

since this question should not be asked in stackoverflow, but I googled and researched for hours, but unable to find meaning.

roarfromror
  • 276
  • 1
  • 2
  • 11

1 Answers1

1

http://apidock.com/rails/ActiveRecord/Base/update_all/class

update_all just updates all records in a table - in this case, whichever table is represented by resource. In this case, you're updating all records to set the online column to true.

Basically, if you've just signed in, the application wants to mark you as online.

joshua.paling
  • 13,762
  • 4
  • 45
  • 60
  • he he he, my question was really ridiculous, I was thinking that 'online: true' is a rails built-in options, but actually it's a column in table. Thanks joshua.paling for clarifying. – roarfromror Feb 12 '15 at 12:59