This file contains 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 crossover_sku(sku) | |
sku1 = sku.code.split("-")[0..3].join("-") | |
sku2 = sku.code.split("-")[4..7].join("-") | |
[sku1, sku2] | |
end | |
This file contains 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 rfidDevice | |
{ | |
eventHandler = null; | |
serPort = null; | |
enabled = true; | |
rxData = ""; | |
name = "Source"; | |
type = "string"; |
This file contains 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 create_directly | |
@attachment = Attachment.new | |
file_name = params[:file_name] | |
if request.body.class == StringIO | |
FileUtils.mkdir "#{Rails.root}/tmp/" + @attachment.id.to_s | |
file = File.open("#{Rails.root}/tmp/" + @attachment.id.to_s + "/" + file_name, "w") | |
file << request.body.string | |
file.close | |
@attachment.attachment = File.open("#{Rails.root}/tmp/" + @attachment.id.to_s + "/" + file_name, "r") |
NewerOlder