app/controllers/anoubis/core/application_controller.rb
##
# Saves user data into redis database and returns user JSON representation
# @param user [ActiveRecord] current user data
# @return [String] JSON representation of user data
Saves user data into redis database and returns user JSON representation
Saves user data into redis database and returns user JSON representation
def redis_save_user(user)
    user_json = user.to_json(except: self.get_user_model_except)
    user_hash = JSON.parse user_json, { symbolize_names: true }
    user_hash[:uuid] = user.uuid
    user_json = user_hash.to_json
    self.redis.set(self.redis_prefix + 'user:' + user.uuid, user_json)
    user_json
  end
def redis_save_user ( user ) user_json = user . to_json ( except : self . get_user_model_except ) user_hash = JSON . parse user_json , { symbolize_names : true } user_hash [ :uuid ] = user . uuid user_json = user_hash . to_json self . redis . set ( self . redis_prefix + 'user:' + user . uuid , user_json ) user_json end
Saves user data into redis database and returns user JSON representation
Saves user data into redis database and returns user JSON representation
JSON representation of user data
JSON representation of user data
String
user
current user data
current user data