Skip to content

Instantly share code, notes, and snippets.

@dwaynemac
Last active February 4, 2016 22:48
Show Gist options
  • Save dwaynemac/231e4fb325f41f2fd8a5 to your computer and use it in GitHub Desktop.
Save dwaynemac/231e4fb325f41f2fd8a5 to your computer and use it in GitHub Desktop.
config.user.custom_data = { [20/104]
user_id: Proc.new { |user| user.username }, # eg: 'dwayne.macgowan'
language_override: Proc.new { |user| user.locale.try(:first,2) }, # valores: 'es', 'pt'
name: Proc.new { |user| user.username.split('.').join(' ').titleize if user.username }, # eg: 'Dwayne Macgowan'
is_admin: Proc.new { |user| user.padma_roles_in(user.current_account.name).try(:include?,'admin') if user.current_account },
created_at: Proc.new {|user| nil } # created_at should only be sent by accounts-ws
}
config.company.custom_data = {
id: Proc.new { |account| account.name }, # eg: 'belgrano', 'cervino', 'jardins', 'alamedacampinas'
name: Proc.new { |account| account.name },
full_name: Proc.new{ |account| account.padma.full_name }, # eg: 'DeROSE Method - Belgrano'
enabled: Proc.new { |account| account.padma.try(:enabled) },
created_at: Proc.new {|_| nil }, # created_at should only be sent by accounts-ws
migrated_at: Proc.new { |account| account.padma.try(:migrated_to_padma_on).try(:to_time).try(:to_i) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment