conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix require 'environment' => 'config/environment'\n" }, { "from": "human", "value": "namespace :user_system_has_accounts do\n\n desc \"Create a new Account Type\"\n task :create_account_type do\n ac = AccountType.new\n AccountType.columns.collect(&:name).eac...
ruby
chosen
[ { "from": "system", "value": "Store Controller Test for navigation, record number, sample title, and price formatting\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass StoreControllerTest < ActionController::TestCase\n test \"should get index\" do\n get :index\n assert_res...
ruby
chosen
[ { "from": "system", "value": "Refactor to reduce method length.\n" }, { "from": "human", "value": "require_relative 'mayusculas'\n\nmodule Identificamex\n\n # Clase base para normalizar las cadenas de nombres y apellidos. La clase\n # se encarga de convertir a mayúsculas las cadenas y recorre ...
ruby
chosen
[ { "from": "system", "value": "Update secret token to fix current sessions\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Your secret key for verifying the integrity of signed cookies.\n# If you change this key, all old signed cookies will beco...
ruby
chosen
[ { "from": "human", "value": "Add a rake task to compute the match percentages\n" }, { "from": "gpt", "value": "desc \"Compute the match percentages for all of the user pairs in a section\"\ntask :compute_match_percentages => :environment do\n (\"A\"..\"J\").each do |section|\n puts \"Section...
ruby
chosen
[ { "from": "system", "value": "Add usefull comment about email devilery\n" }, { "from": "human", "value": "class FeedbackController < FrontendController\n def new\n @seo_carrier ||= OpenStruct.new(title: I18n.t('defaults.page_titles.feedback'))\n @feedback = Feedback.new\n end\n\n def cr...
ruby
chosen
[ { "from": "system", "value": "Fix shipping reporting in Piwik\n" }, { "from": "human", "value": "class InvoicesController < ApplicationController\n \n def uuid\n @invoice = Invoice.find_by_uuid(params[:uuid])\n if @invoice.nil?\n flash[:error] = \"This invoice does not exist.\"\n ...
ruby
chosen
[ { "from": "system", "value": "Add comment to clarify logged_in cookie\n" }, { "from": "human", "value": "class SessionsController < Devise::SessionsController\n after_action :set_logged_in, only: :create\n before_action :unset_logged_in, only: :destroy\n\n def set_logged_in\n if (user_sign...
ruby
chosen
[ { "from": "system", "value": "Fix logging in validation for user\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n @user = User.new\n end\n\n def create\n @user = User.find_by(email: user_params[:email])\n if @user.password == params[:p...
ruby
chosen
[ { "from": "human", "value": "Add new and create routes\n" }, { "from": "gpt", "value": "class SessionsController < ApplicationController\n\n def new\n @user = User.new\n end\n\n def create\n if user = User.find_by(username: params[:session][:username]).try(:authenticate, params[:session...
ruby
chosen
[ { "from": "system", "value": "Fix the columns being selected\n" }, { "from": "human", "value": "class Promo::EmailBreakdownsJob\n include Sidekiq::Worker\n sidekiq_options queue: :low, retry: true\n\n def perform(publisher_id)\n referral_codes = PromoRegistration.where(publisher_id: publis...
ruby
chosen
[ { "from": "system", "value": "Add a test for the title of the homepage.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe HomeController do\n\n describe \"GET 'index'\" do\n it \"returns http success\" do\n get 'index'\n response.should be_success\n end\n end...
ruby
chosen
[ { "from": "system", "value": "Allow running migrations when association is gone\n" }, { "from": "human", "value": "class AddProjectNameToTeams < ActiveRecord::Migration\n def up\n add_column :teams, :project_name, :string\n\n Project.joins(:team).each do |project|\n project.team.upda...
ruby
chosen
[ { "from": "human", "value": "Change podcast explicit to a string not a boolean\n" }, { "from": "gpt", "value": "class ChangeExplicitToString < ActiveRecord::Migration\n def up\n rename_column :podcasts, :explicit, :explicit_boolean\n add_column :podcasts, :explicit, :string\n execute \...
ruby
chosen
[ { "from": "system", "value": "Fix warning on virtual machines with no PCI bus\n" }, { "from": "human", "value": "# Create nagios_pci_<modname> facts for these modules, if found\nmodnames = [ \"megaraid\", \"megaraid_sas\", \"mptsas\" ]\n\nFile.open(\"/proc/bus/pci/devices\") do |io|\n io.each...
ruby
chosen
[ { "from": "system", "value": "Add method to send email.\n\nRequires a mailserver (postfix on localhost will work)\n" }, { "from": "human", "value": "#!/usr/bin/env ruby -w\n\n#Class that reaches out to the processor's payment network to process payments\nclass @@method\n @@cents #Use cents to ...
ruby
chosen
[ { "from": "system", "value": "Create data/log dirs if we change them from defaults\n" }, { "from": "human", "value": "template \"/etc/grafana/grafana.ini\" do\n owner \"root\"\n group \"root\"\n mode \"0644\"\n variables :config => node['chef-grafana']['config']\n notifies :restart, \"servi...
ruby
chosen
[ { "from": "system", "value": "Fix order-dependent Gitaly specs failing\n\nIf `spec/tasks/gitlab/cleanup_rake_spec.rb` preceded any of the Gitaly\nrequest specs, it would import the `cleanup.rake` and the global\nfunction `limit`. For some reason, the Protobuf implementation would use\nthe global function in...
ruby
chosen
[ { "from": "system", "value": "Use `eq` instead of `be ==`\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Traders\" do\n\n Trader.all.each do |short_name, trader|\n it short_name, :vcr do\n trader.fetch\n\n expect(trader.rates).not_to be_empty\n expect(t...
ruby
chosen
[ { "from": "system", "value": "Fix line length at budget investments helper\n" }, { "from": "human", "value": "module BudgetInvestmentsHelper\n def budget_investments_sorting_options\n Budget::Investment::SORTING_OPTIONS.map { |so| [t(\"admin.budget_investments.index.sort_by.#{so}\"), so] }\n...
ruby
chosen
[ { "from": "system", "value": "Split SolidusEasypost::Estimator logic into multiple methods\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule SolidusEasypost\n class Estimator\n def shipping_rates(package, _frontend_only = true)\n shipment = package.easypost_ship...
ruby
chosen
[ { "from": "system", "value": "Increase default waiting time and add timeout for poltergeist\n" }, { "from": "human", "value": "require 'capybara/poltergeist'\n\n# disable logger\nmodule NullPoltergeistLogger\n def self.puts(*)\n end\nend\n\n# Driver setup to not fill output with logging\nCapyb...
ruby
chosen
[ { "from": "system", "value": "Add a better failing test\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TicTacToe do\n it 'has a version number' do\n expect(TicTacToe::VERSION).not_to be nil\n end\n\n it 'does something useful' do\n expect(false).to eq(true)\n end\...
ruby
chosen
[ { "from": "system", "value": "Add an expectation of type\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe TicTacToe do\n it 'has a version number' do\n expect(TicTacToe::VERSION).not_to be nil\n end\n\n it 'has a game' do\n game = TicTacToe::Game.new\n end\nend\n" ...
ruby
chosen
[ { "from": "system", "value": "Tweak plugin spec to not use InstanceMethods\n" }, { "from": "human", "value": "require 'helper'\n\ndescribe Toy::Plugins do\n uses_constants('User', 'Game')\n\n it \"keeps track of class that include toy store\" do\n Toy.models.should == [User, Game]\n end\n\...
ruby
chosen
[ { "from": "system", "value": "[Path] Update spec for wrapping path in backticks\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe \"path sources\" do\n describe \"bundle update --source\" do\n it \"shows the previous version of the gem when updated from path source\" do\...
ruby
chosen
[ { "from": "system", "value": "Load AppAnnie source before loading AppAnnieProductSales source.\n" }, { "from": "human", "value": "require 'sequel'\n\nrequire 'active_support/core_ext/hash'\n\nrequire 'optimus_prime/pipeline'\nrequire 'optimus_prime/step'\nrequire 'optimus_prime/source'\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Allow all domains for cookies in development env\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n\nif Rails.env.production?\n EmpiricalGrammar::Application.config.session_store :cookie_store, key: '_quill_session', ...
ruby
chosen
[ { "from": "system", "value": "Move current to a class method\n\nas it will return [] instead of nil if there is not current sprint\notherwise.\n" }, { "from": "human", "value": "class Sprint < ApplicationRecord\n validates :start_date, :end_date, presence: true\n\n validate :no_weekend_day\n\n...
ruby
chosen
[ { "from": "system", "value": "Order transactions by posted date" }, { "from": "human", "value": "class TransactionsController < ApplicationController\n respond_to :json\n\n before_filter only: [:index] do\n get_to_from\n end\n \n def index\n transactions = Transaction.with_matcher\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix the ckeditor breaking changes.\n" }, { "from": "human", "value": "# encoding: utf-8\nclass CkeditorPictureUploader < CarrierWave::Uploader::Base\n include Ckeditor::Backend::CarrierWave\n\n # Include RMagick or ImageScience support:\n # include CarrierWave::R...
ruby
chosen
[ { "from": "system", "value": "Fix typo in UserProfiles JSON\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\njson.user_profile do\n json.call(@user, :username, :profile_image)\n json.bio @user.user_profile&.bio\n json.location @user.user_profile&.location\n json.instution ...
ruby
chosen
[ { "from": "system", "value": "Make ActiveRecord worker wakeups thread-safe.\n" }, { "from": "human", "value": "module Que\n module Adapters\n class ActiveRecord < Base\n def checkout\n ::ActiveRecord::Base.connection_pool.with_connection do |conn|\n @conn = conn\n ...
ruby
chosen
[ { "from": "system", "value": "Fix to set the right tag.\n" }, { "from": "human", "value": "module SUNAT\n\n class TaxSubTotal\n include Model\n \n property :tax_amount, PaymentAmount\n property :tax_category, TaxCategory\n \n def build_xml(xml)\n xml['cac'].TaxSubTotal ...
ruby
chosen
[ { "from": "system", "value": "Enable memcached in acceptance tests\n\n... because it is required as cache backend.\n\nChange-Id: I1da59bacb6dfba7fe439d0c94e12f9968c5f501e\n" }, { "from": "human", "value": "require 'spec_helper_acceptance'\n\ndescribe 'basic ironic' do\n\n context 'default param...
ruby
chosen
[ { "from": "system", "value": "Remove delete_all for models that depend Dojo in spec\n" }, { "from": "human", "value": "require 'rails_helper'\nrequire 'statistics'\n\nRSpec.describe Statistics::Aggregation do\n include_context 'Use stubs for Faraday'\n\n before(:all) do\n Dojo.delete_all\n ...
ruby
chosen
[ { "from": "system", "value": "Disable search filters for now" }, { "from": "human", "value": "class SearchController < ApplicationController\n def index\n scope = Project.search(params[:q])\n scope = scope.platform(params[:platform]) if params[:platform].present?\n scope = scope.licens...
ruby
chosen
[ { "from": "system", "value": "Create new record for new messages\n" }, { "from": "human", "value": "class TwilioController < ApplicationController\n def new_message\n \n end\nend\n" }, { "from": "gpt", "value": "class TwilioController < ApplicationController\n def new_message\n...
ruby
chosen
[ { "from": "system", "value": "Use subject in comment notifier\n" }, { "from": "human", "value": "class NotifyAboutComment\n attr_reader :comment, :current_user\n attr_initialize [:comment, :current_user]\n\n def call\n if notify(comment)\n Response::Success.new(message: \"Sent notific...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.5 to 0.1.6\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'event_store-messaging'\n s.summary = 'Messaging primitives for EventStore using the EventStore Client HTTP libr...
ruby
chosen
[ { "from": "system", "value": "Exclude version file from simplecov\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire 'simplecov'\nSimpleCov.start 'rails'\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire 'rspec/rails'\nrequire 'rspec/autorun'\n...
ruby
chosen
[ { "from": "system", "value": "Use a path for the bundle install\n" }, { "from": "human", "value": "omnibus_path = File.join(node['delivery_builder']['repo'], 'omnibus-delivery-cli')\n\nexecute \"bundle install --binstubs=#{omnibus_path}/bin\" do\n cwd omnibus_path\nend\n\nexecute \"#{omnibus_pa...
ruby
chosen
[ { "from": "human", "value": "Add some helpers for login steps\n" }, { "from": "gpt", "value": "module RoomsFeatures\n module LoginHelper\n def omniauth_hash\n hash = OmniAuth::AuthHash.new(provider: :nyulibraries, uid: 'dev123')\n hash.info = omniauth_info\n hash.extra = omnia...
ruby
chosen
[ { "from": "system", "value": "Simplify shared User SSH key steps\n" }, { "from": "human", "value": "module SharedUser\n include Spinach::DSL\n\n step 'User \"John Doe\" exists' do\n user_exists(\"John Doe\", { username: \"john_doe\" })\n end\n\n step 'User \"Mary Jane\" exists' do\n us...
ruby
chosen
[ { "from": "system", "value": "Remove old table called agents if it exists\n" }, { "from": "human", "value": "class CreateAgents < ActiveRecord::Migration\n def up\n create_table :agents do |t|\n t.string :first_name\n t.string :last_name\n t.references :team, index: true, fore...
ruby
chosen
[ { "from": "system", "value": "Use all data endpoint in gem test\n" }, { "from": "human", "value": "require 'helper'\n\nclass YankCommandTest < CommandTest\n context \"yanking\" do\n setup do\n @gem = \"MyGem\"\n @version = '0.1.0'\n @api = \"https://rubygems.org/api/v1/gems/#{...
ruby
chosen
[ { "from": "system", "value": "Update Grand Prix Carl Decker min and max events\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Competitions\n module GrandPrixBradRoss\n class Overall < Competitions::Overall\n include GrandPrixBradRoss::Common\n\n before_c...
ruby
chosen
[ { "from": "system", "value": "Add code to end campaign and redirect users who come to the site\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery\n\n before_filter :ref_to_cookie\n\n def mobile_device?\n if session[:mobi...
ruby
chosen
[ { "from": "system", "value": "Fix Healthcheck action, check for db connectivity\n" }, { "from": "human", "value": "class HealthcheckController < ActionController::Base\n # rescue_from ApiEntity::Error do |e|\n # render text: '', status: :error\n # end\n\n def check\n # Check API connect...
ruby
chosen
[ { "from": "system", "value": "Fix bug that was creating duplicates of papers with different-cased identifiers\n" }, { "from": "human", "value": "class IdentifiersController < ApplicationController\n def doi\n @doi = 'doi: ' + params[:identifiers].downcase\n @doi_condensed = 'doi:' + param...
ruby
chosen
[ { "from": "system", "value": "Add logo large in partner serialize\n" }, { "from": "human", "value": "class Api::PartnerSerializer < ActiveModel::Serializer\n\n attributes :id, :name, :description, :url, :logo, :white_logo, :logo_medium,\n :white_logo_medium, :logo_size, :contact_name, :conta...
ruby
chosen
[ { "from": "system", "value": "Use Bundler 2 in development\n\nSigned-off-by: Steven Hoffman <46f1a0bd5592a2f9244ca321b129902a06b53e03@fustrate.com>\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Copyright (c) 2019 Valencia Management Group\n# All rights reserved.\n\nlib = ...
ruby
chosen
[ { "from": "system", "value": "Disable background processing for party_foul.\n" }, { "from": "human", "value": "PartyFoul.configure do |config|\n # the collection of exceptions to be ignored by PartyFoul\n # The constants here *must* be represented as strings\n config.blacklisted_exceptions = ...
ruby
chosen
[ { "from": "system", "value": "Debug search method in ActiveRecord\n" }, { "from": "human", "value": "module ActiveRecord\n class Base\n\n ##\n # Search method\n #-----\n def self.search(in_parameters = {})\n return all if (in_parameters.blank?)\n conditions = ['1']\n ...
ruby
chosen
[ { "from": "system", "value": "Disable :fr lang in Refinery::I18n\n" }, { "from": "human", "value": "# encoding: utf-8\n\nRefinery::I18n.configure do |config|\n config.default_locale = :en\n\n config.current_locale = :en\n\n config.default_frontend_locale = :en\n\n config.frontend_locales = [...
ruby
chosen
[ { "from": "system", "value": "Switch to using bundler to install Ruby Gems\n" }, { "from": "human", "value": "name 'coopr-provisioner'\ndefault_version 'release/0.9.9'\n\ndependency 'ruby'\ndependency 'rubygems'\ndependency 'bundler'\n\nsource :git => 'git://github.com/caskdata/coopr-provisioner...
ruby
chosen
[ { "from": "system", "value": "Update default Node.js to 0.10.35\n" }, { "from": "human", "value": "default[:nodejs][:default] = \"0.10.33\"\ndefault[:nodejs][:versions] = [ node[:nodejs][:default] ]\ndefault[:nodejs][:aliases] = { node[:nodejs][:default] => node[:nodejs][:default][/\\d+\\.\\d+...
ruby
chosen
[ { "from": "system", "value": "Order my friends by name\n" }, { "from": "human", "value": "require 'fb_service'\n\nclass FbFriendsController < ApplicationController\n before_filter :authenticate_user!\n #before_filter :check_facebook_session, :only => [:index, :search_fb_friends]\n\n def index...
ruby
chosen
[ { "from": "system", "value": "Fix redirect oddness after resetting password\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery...
ruby
chosen
[ { "from": "system", "value": "Add a few common verbs to hamzated verb hash\n" }, { "from": "human", "value": "# encoding: utf-8\n\nFORM_I_HAMZATED = {\n \"بدء\" => \"أ\",\n \"سءل\" => \"أ\"\n}" }, { "from": "gpt", "value": "# encoding: utf-8\n\nFORM_I_HAMZATED = {\n \"بدء\" => \"أ...
ruby
chosen
[ { "from": "system", "value": "Add sitemap name to SitemapResult\n" }, { "from": "human", "value": "# Contains the result of a sitemap generation\n\nmodule DynamicSitemaps\n class SitemapResult\n attr_reader :sitemap, :files\n\n def initialize(sitemap, files)\n @sitemap = sitemap\n ...
ruby
chosen
[ { "from": "system", "value": "Include CurationConcern helper to provide all_type_tab method\n" }, { "from": "human", "value": "module Sufia\n module Catalog\n extend ActiveSupport::Concern\n included do\n self.search_params_logic += [:only_works_and_collections, :show_works_or_works_...
ruby
chosen
[ { "from": "system", "value": "Fix bug with modified key stack\n" }, { "from": "human", "value": "module Delocalize\n module ParameterDelocalizing\n def delocalize(options)\n delocalize_hash(self, options)\n end\n\n private\n\n def delocalize_hash(hash, options, key_stack = [])\n ...
ruby
chosen
[ { "from": "system", "value": "Store DM attributes with mass assignment\n" }, { "from": "human", "value": "class Fabrication::Generator::DataMapper < Fabrication::Generator::Base\n\n def self.supports?(klass)\n defined?(DataMapper) && klass.ancestors.include?(DataMapper::Hook)\n end\n\n pro...
ruby
chosen
[ { "from": "system", "value": "Improve performance and memory consumption of NormalizedHeaderHash::convert_key method\n\n- replace split by regex with tr and split by string\n- freeze often used string literals\n- use map! for in place mapping of segments\n" }, { "from": "human", "value": "module...
ruby
chosen
[ { "from": "system", "value": "Fix mistake in Sqlint doc comment\n\nThat's what I get for copy-pasting!" }, { "from": "human", "value": "module Overcommit::Hook::PreCommit\n # Runs 'sqlint' against any modified Puppet files.\n #\n # @see https://github.com/purcell/sqlint\n class Sqlint < Base...
ruby
chosen
[ { "from": "system", "value": "Modify Schema for registration edit\n" }, { "from": "human", "value": "module Devise\n module Orm\n module CouchrestModel\n module Schema\n include Devise::Schema\n # Tell how to apply schema methods.\n def apply_devise_schema(name, typ...
ruby
chosen
[ { "from": "system", "value": "Add common-data tag by default\n" }, { "from": "human", "value": "require_relative '../../app/models/common_data'\n\nnamespace :cartodb do\n\n namespace :remotes do\n\n desc 'Remove common data remotes'\n task :remove do\n CartoDB::Visualization::Collect...
ruby
chosen
[ { "from": "system", "value": "Use JSON cookies as in wrapper\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nRails.application.config.action_dispatch.cookies_serializer = :marshal\n" }, { "from": "gpt", "value": "# Be sure to restart ...
ruby
chosen
[ { "from": "system", "value": "Add fields to recipe table\n" }, { "from": "human", "value": "class Recipes < ActiveRecord::Migration\n def change\n create_table :recipes do |t|\n t.string :name\n\n t.timestamps null: false\n end\n end\nend\n" }, { "from": "gpt", "val...
ruby
chosen
[ { "from": "system", "value": "Remove the do not redistribute clause in the zookeeper cookbook. There's nothing webtrends specific in this\n\n\nFormer-commit-id: 4fad8f2232bb1447d361ea6a91a140d576bf84b8 [formerly 45f1a9aace9396eb81063db20753ac21fe3ddf21] [formerly 070a921e8f2dc5d4a26f810bbd10a8617981b1e8 [f...
ruby
chosen
[ { "from": "system", "value": "Use the bulk_republishing queue in PubApiDocRepublisher\n\nThis is a special republisher that is used for Editions, but it seems\nto be currently using the `default` queue. This means that when it's\nused it will flood the `default` queue and block all other\nrepublishing until...
ruby
chosen
[ { "from": "human", "value": "Add a package for Procedural Fairings.\n" }, { "from": "gpt", "value": "class ProceduralFairings < Kosmos::Package\n title 'Procedural Fairings'\n url 'https://github.com/e-dog/ProceduralFairings/releases/download/v3.02/ProcFairings_3.02.zip'\n\n def install\n ...
ruby
chosen
[ { "from": "system", "value": "Add parenthesis around method call\n" }, { "from": "human", "value": "module Munge\n module Transformers\n class TiltTransformer\n def initialize(scope)\n @pristine_scope = scope\n @registry = []\n @demands = Hash.new { Has...
ruby
chosen
[ { "from": "human", "value": "Make sorting work with basic attributes corresponding to database fields.\n" }, { "from": "gpt", "value": "module QuerySortByParams\n\tmodule ParamSortable\n\t\textend ActiveSupport::Concern\n\n\t\tincluded do\n\t\tend\n\n\t\tmodule ClassMethods\n\t\t\tdef sort_by_pa...
ruby
chosen
[ { "from": "system", "value": "Update `PutPublishIntent` command to omit `payload_version`\n" }, { "from": "human", "value": "module Commands\n class PutPublishIntent < BaseCommand\n def call\n PathReservation.reserve_base_path!(base_path, payload[:publishing_app])\n\n if downstream...
ruby
chosen
[ { "from": "system", "value": "Rewrite user stat query for improved performance of homepage\n" }, { "from": "human", "value": "class HomeController < BaseController\n layout 'darkswarm'\n\n before_filter :enable_embedded_shopfront\n\n def index\n if ContentConfig.home_show_stats\n @num...
ruby
chosen
[ { "from": "system", "value": "Add create method to jobs controller\n" }, { "from": "human", "value": "class JobsController < ApplicationController\n def index\n end\n\n def new\n @job = Job.new\n end\nend\n" }, { "from": "gpt", "value": "class JobsController < ApplicationContr...
ruby
chosen
[ { "from": "system", "value": "Move paypal button below checkout button\n" }, { "from": "human", "value": "Deface::Override.new(\n virtual_path: 'spree/orders/edit',\n name: 'Add PayPal button',\n insert_before: 'erb[loud]:contains(\"checkout-link\")',\n partial: 'spree/braintree_vzero/paypal...
ruby
chosen
[ { "from": "system", "value": "Fix flow serializer to obtain user journals" }, { "from": "human", "value": "class FlowSerializer < ActiveModel::Serializer\n attributes :id, :title, :empty_text\n has_many :lite_papers, embed: :ids, include: true, serializer: LitePaperSerializer\n has_many :task...
ruby
chosen
[ { "from": "human", "value": "Add Algorithms module with T and Y PLLs\n" }, { "from": "gpt", "value": "module CubeSolver\n module Algorithms\n module PLL\n T = \"R U R' U' R' F R2 U' R' U' R U R' F'\"\n Y = \"U F R U' R' U' R U R' F' R U R' U' R' F R F' U'\"\n end\n end\nend\n" ...
ruby
chosen
[ { "from": "human", "value": "Add tests for compiling in different crate modes\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire 'support/editor'\n\nRSpec.feature \"Building \", type: :feature, js: true do\n before :each do\n visit '/'\n end\n\n scenario \"when the crate is a ...
ruby
chosen
[ { "from": "system", "value": "Change ValueNotAllowedError code & message\n\nto match ActiveModel::Errors.\n" }, { "from": "human", "value": "module InputSanitizer\n class OptionalValueOmitted < StandardError; end\n\n class KeyNotAllowedError < ArgumentError; end\n\n class ValidationError < St...
ruby
chosen
[ { "from": "system", "value": "Add Helper for Converting T/F to Yes/No\n\n" }, { "from": "human", "value": "module ApplicationHelper\n def bootstrap_class_for(flash_type)\n case flash_type.to_sym\n when :error, :alert\n ' alert-danger '\n when :warning\n ' alert-warning '\n ...
ruby
chosen
[ { "from": "system", "value": "Fix SlimTemplate mime type registration\n" }, { "from": "human", "value": "require \"slim\"\n\n\nmodule Madride\n class SlimTemplate < Slim::Template\n class << self\n attr_reader :default_mime_type\n @default_mime_type = 'text/html'\n end\n end\ne...
ruby
chosen
[ { "from": "system", "value": "Use bearer token for publishing API authentication\n" }, { "from": "human", "value": "namespace :publishing_api do\n desc \"Publish special routes such as the homepage\"\n task :publish_special_routes => :environment do\n require 'gds_api/publishing_api/special...
ruby
chosen
[ { "from": "system", "value": "203: Simplify throttling of ODK Collect endpoints\n" }, { "from": "human", "value": "class Rack::Attack::Request\n def direct_auth?\n if path =~ %r{^/m/[a-z][a-z0-9]*/(.*)$}\n subpath = $1\n\n return true if subpath == 'formList.xml'\n return true...
ruby
chosen
[ { "from": "system", "value": "Allow admin to manage applications for users\n" }, { "from": "human", "value": "RailsAdmin.config do |config|\n\n ### Popular gems integration\n\n # == Devise ==\n config.authenticate_with do\n warden.authenticate! scope: :admin\n end\n config.current_user_m...
ruby
chosen
[ { "from": "system", "value": "Add changing the root password to the CentOS recipe\n" }, { "from": "human", "value": "#Make sure that this recipe only runs on ubuntu systems\nif platform?(\"centos\")\n\n#Base recipes necessary for a functioning system\ninclude_recipe \"sudo\"\n#include_recipe \"a...
ruby
chosen
[ { "from": "system", "value": "Refactor longer varname to pair\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe 'CoinsMarkets integration specs' do\n client = Cryptoexchange::Client.new\n\n it 'fetch pairs' do\n pairs = client.pairs('coins_markets')\n expect(pair...
ruby
chosen
[ { "from": "system", "value": "Check for nil value before calling join.\n" }, { "from": "human", "value": "module Mongoid\n module ArrayList\n def self.included(base)\n base.extend(ClassMethods)\n end\n \n module ClassMethods\n def list_field(field)\n define_method \...
ruby
chosen
[ { "from": "system", "value": "Handle passing an uppercase language to add language generator\n" }, { "from": "human", "value": "module TranslationCenter\n\n class AddLangGenerator < Rails::Generators::Base\n include Rails::Generators::Migration\n source_root File.expand_path('../templates...
ruby
chosen
[ { "from": "system", "value": "Reduce speed to 50 wpm for CI testing\n" }, { "from": "human", "value": "require 'parseconfig.rb'\n\nmodule CWG\n\n module Cfg\n\n HERE = File.dirname(__FILE__) + '/'\n\n CONFIG_METHODS = [\n :name,:wpm,:effective_wpm,:frequency,:audio_filename,:audio_di...
ruby
chosen
[ { "from": "human", "value": "Create script for generating sponsor files\n\nThis ruby script basically reads in a city config file and creates the sponsor file associated with it. It will NOT create the images, naturally, but this will make it somewhat easier.\n\n\nFormer-commit-id: a31dbc664cf7c91c43bce9a16...
ruby
chosen
[ { "from": "system", "value": "Add default class options to create dummy app and and mountable engine\n" }, { "from": "human", "value": "require 'rails/generators'\nrequire 'rails/generators/rails/app/app_generator'\nrequire 'rails/generators/rails/plugin_new/plugin_new_generator'\n\nmodule Benzi...
ruby
chosen
[ { "from": "system", "value": "Load app/{crawler,processor}.rb when run crawler/processor\n" }, { "from": "human", "value": "require \"thor\"\nrequire \"daimon_skycrawlers\"\nrequire \"daimon_skycrawlers/crawler\"\n\nmodule DaimonSkycrawlers\n module Commands\n class Runner < Thor\n name...
ruby
chosen
[ { "from": "human", "value": "Add Out on the Weekend\n" }, { "from": "gpt", "value": "# Section 3 - Lesson 4 - All the 'B's: Bb, Bbm, B, Bm\n# Rhythm - Half Beat Bounce\n# Out on the weekend - Neil Young\nrequire \"#{Dir.home}/ruby/pianoforall/section03/lesson04/half_beat_bounce\"\nuse_synth :pia...
ruby
chosen
[ { "from": "system", "value": "Make sure to include the shell when stealing the manifest.\n" }, { "from": "human", "value": "module Heroku::Deploy::Task\n class StealManifest < Base\n def before_push\n manifest_url = \"http://#{app.host}/assets/manifest.yml\"\n asset_path = \"public...
ruby
chosen
[ { "from": "system", "value": "Remove home page for now\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe HomeController do\n\n describe 'GET #index' do\n\n def make_request\n get :index\n end\n \n it 'should render the home/index template' do \n make_req...
ruby
chosen
[ { "from": "system", "value": "Fix dependency on existing configuration\n" }, { "from": "human", "value": "module Imap::Backup\n describe CLI::Mirror do\n subject { described_class.new(source, destination, **options) }\n\n let(:source) { \"source\" }\n let(:destination) { \"destination\...
ruby
chosen