Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!@order.group.name.blank?) #old matching code: !(o.group.name.match /^ml_/).nil?
- # Thu Oct 28 23:56:18 IST 2010
- # QUESTION:
- # * This logic will calculate master group name "Besmaster" for "BestBuy" group
- # * Do we need "be_master" ?
- # alternate suggested logic:
- # * remove vowels, pick first 3 or 5 characters, add "_master" to it
- # <group name>.delete("a,e,i,o,u")[0..2].downcase + "_master"
- # * yields "bst_master" for "BestBuy"
- master_group = Group.find_by_name(@order.group.name[0..2] + 'master') #eg. find ml_master group
- if !master_group.nil? and !master_group.email.blank?
- UserMailer.deliver_order_summary(@order, master_group.email)
- end
- end
Add Comment
Please, Sign In to add comment