This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AccountRecord | |
require 'levenshtein_damerau' | |
include Mongoid::Document | |
extend Mongoid::Geo::Near | |
field :salesforce | |
field :name | |
field :phone | |
field :billing_address | |
field :name_soundex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_survey_score(user) | |
return false if !self.taken?(user) | |
all_questions = self.questions.order("id ASC").to_a | |
case self.name | |
when "Personality" | |
introvert = 0 | |
extrovert = 0 | |
sensing = 0 | |
intuition = 0 | |
thinking = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.calcStat(player, team, gameData) | |
playerIn = false | |
totalTimeIn = 0 | |
inTime = 0 | |
inDiff = 0 | |
totalPointDiff = 0 | |
otherTeam = team == :home ? :visitor : :home | |
gameData.each do |state| |