<commit_before>require 'json'
require 'rest_client'
class HomeController < ApplicationController
  include AdminHelper
  include CartHelper

  before_action :authenticate_user!, only: 'account'

  def index

    @config_products = ConfigurationWeb.where content_type: 1
    @cart_product_shared = params['cp']
    @shared_image = 'http://organichustler.com/images/logo'

  end

  def save_to_share
    product = CartProduct.create! do |u|
      u.product_id = params[:product][:product_id]
      u.size_id = params[:product][:size_id]
      u.color_id = params[:product][:color_id]
    end

    params[:product][:views].each do |index|

      custom_view = params[:product][:views][index]

      unless custom_view[:logo_id].blank?
        product.custom_logos << CustomLogo.create! do |cl|
          cl.product_image_id = custom_view[:picture_id]
          cl.color_id = custom_view[:color_id]
          cl.logo_id = custom_view[:logo_id]
          cl.x = custom_view[:x]
          cl.y = custom_view[:y]
          cl.multiplexer = custom_view[:multiplexer]
        end
      end

      unless custom_view[:position_emblem_id].blank?
        product.custom_emblems << CustomEmblem.create! do |ce|
          ce.product_image_id = custom_view[:picture_id]
          ce.color_id = custom_view[:color_id]
          ce.position_emblem_admin_id = custom_view[:position_emblem_id]
        end
      end<commit_msg>test2<commit_after>require 'json'
require 'rest_client'
class HomeController < ApplicationController
  include AdminHelper
  include CartHelper

  before_action :authenticate_user!, only: 'account'

  def index

    @config_products = ConfigurationWeb.where content_type: 1
    @cart_product_shared = params['cp']
    @shared_image = 'http://organichustler.com/images/logo'

  end

  def save_to_share
    product = CartProduct.create! do |u|
      u.product_id = params[:product][:product_id]
      u.size_id = 1
      u.color_id = params[:product][:color_id]
    end

    params[:product][:views].each do |index|

      custom_view = params[:product][:views][index]

      unless custom_view[:logo_id].blank?
        product.custom_logos << CustomLogo.create! do |cl|
          cl.product_image_id = custom_view[:picture_id]
          cl.color_id = custom_view[:color_id]
          cl.logo_id = custom_view[:logo_id]
          cl.x = custom_view[:x]
          cl.y = custom_view[:y]
          cl.multiplexer = custom_view[:multiplexer]
        end
      end

      unless custom_view[:position_emblem_id].blank?
        product.custom_emblems << CustomEmblem.create! do |ce|
          ce.product_image_id = custom_view[:picture_id]
          ce.color_id = custom_view[:color_id]
          ce.position_emblem_admin_id = custom_view[:position_emblem_id]
        end
      end
{'fraction_non_alphanumeric': 0.10564139417894358, 'fraction_numerical': 0.001437297879985627, 'mean_word_length': 3.1122599704579024, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3203228', 'n_tokens_mistral': 901, 'n_tokens_neox': 873, 'n_words': 155}