Module: VoiceCom::ModelHelpers

Defined in:
lib/voice_com/model_helpers.rb

Instance Method Summary collapse

Instance Method Details

#uniq_column_idObject



13
14
15
16
17
18
# File 'lib/voice_com/model_helpers.rb', line 13

def uniq_column_id
  #custome column for the uniq sms id, given in the config file
  #when non given uses the first 2 upcase letter of the model  + 'id' column in the database 

  VoiceCom.config["sms_uniq_id_column"]
end

#uniq_sms_idObject



3
4
5
6
7
8
9
10
11
# File 'lib/voice_com/model_helpers.rb', line 3

def uniq_sms_id
  
  if uniq_column_id
    send(uniq_column_id)
  else
    self.class.name.gsub(/[a-z]/, "").downcase + id.to_s
  end

end