conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix spec s_whitehall_backend on non-puppetised machines\n\nBecause this node includes the mirror, which uses the concat module,\nthere will be a test failure if you run the specs on your mac rather\nthan on a linux machine which has the concat module and it's facts\ninstalled.\...
ruby
chosen
[ { "from": "system", "value": "Add dependent destroy to subscription templates from groups\n" }, { "from": "human", "value": "module Subscriptions\n module Concerns\n module Models \n module SubscriptionTemplateGroup\n extend ActiveSupport::Concern\n \n included...
ruby
chosen
[ { "from": "system", "value": "JariBakken: Enable browser connection spec on Android.\n\ngit-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@15725 07704840-8298-11de-bf8c-fd130f914ac9\n" }, { "from": "human", "value": "require File.expand_path(\"../spec_helper\", __FILE__)\n\ndescribe \"Driver\"...
ruby
chosen
[ { "from": "system", "value": "Fix more explicit unauthorized handling for IEP docs'\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe IepDocumentsController, type: :controller do\n\n describe '#show' do\n\n def make_request(id)\n request.env['HTTPS'] = 'on'\n ...
ruby
chosen
[ { "from": "system", "value": "Add test case for the statistic compilation\n\nThe statistic compilation is now covered, too. Although this is more\nlike a dummy test, since the test snapshot does not contain any\nresources. So it is likely that this test is updated in the future.\n\nSigned-off-by: Konrad Rei...
ruby
chosen
[ { "from": "system", "value": "Improve backtraces in API during development\n" }, { "from": "human", "value": "module API\n module V1\n class APIController < ActionController::API\n def api_key\n key = request.headers['X-Api-Key']\n @api_key ||= APIKey.find_by(key: key)\n ...
ruby
chosen
[ { "from": "system", "value": "Order of comments on update\n" }, { "from": "human", "value": "class CampaignUpdate < ActiveRecord::Base\n belongs_to :campaign\n belongs_to :user\n belongs_to :incoming_message\n belongs_to :outgoing_message\n validates_presence_of :text\n has_many :comments,...
ruby
chosen
[ { "from": "human", "value": "Add migration file to create schools\n" }, { "from": "gpt", "value": "class CreateSchools < ActiveRecord::Migration\n def change\n create_table :schools do |t|\n\t\t\tt.string :ats_system_code\n\t\t\tt.string :location_code\n\t\t\tt.string :location_name\n\t\t\tt...
ruby
chosen
[ { "from": "system", "value": "Update gist test to navigate away before following links\n\nIt's really difficult to test permalinks because the page should\nessential remain unchanged. It's easier to make sure things worked if we\ndeliberately go somewhere else (a blank page, for example) and then come\nback...
ruby
chosen
[ { "from": "system", "value": "Improve tabbedCode generator to escape Liquid syntax in code snippets.\n" }, { "from": "human", "value": "module Reading\n class TabbedCodeGenerator < Jekyll::Generator\n\t\tdef generate(site)\t\n\t\t\t@site = site\n\t\t\t@converter = site.getConverterImpl(Jekyll::...
ruby
chosen
[ { "from": "system", "value": "Correct package name for 0mq3\n" }, { "from": "human", "value": "#\n# Cookbook Name:: zeromq\n# Recipe:: ppa\n#\n# Copyright 2011-2013, Travis CI Development Team <contact@travis-ci.org>\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you ...
ruby
chosen
[ { "from": "system", "value": "Change JSON key format to camelized\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nJSONAPI.configure do |config|\n config.default_processor_klass = JSONAPI::Authorization::AuthorizingProcessor\n config.exception_class_whitelist = [Pundit::NotA...
ruby
chosen
[ { "from": "system", "value": "Fix broken test and refactor\n" }, { "from": "human", "value": "require 'test_helper'\n\ndescribe AuthController do\n\n it 'renders the form' do\n get :new\n assert_template :new\n end\n\n it 'redirects to form if no email is posted' do\n post :request_e...
ruby
chosen
[ { "from": "system", "value": "Use jsonapi-serializer for users controller\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Api\n module V1\n class UsersController < ::Api::V1::BaseController\n before_action :set_resource, except: [:index, :create, :current]\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix marine boolean value displaying incorrectly\n" }, { "from": "human", "value": "object @protected_area\n\n# Basic\nattribute :wdpa_id => :id\nattributes :name, :original_name, :wdpa_id\n\nnode :links do |pa|\n if @current_user.access_to?(ProtectedArea, :link_to_...
ruby
chosen
[ { "from": "system", "value": "Fix method used to display content and picture for RSS feed\n" }, { "from": "human", "value": "#\n# == PostDecorator\n#\nclass PostDecorator < ApplicationDecorator\n include Draper::LazyHelpers\n delegate_all\n\n def image\n retina_image_tag first_picture, :im...
ruby
chosen
[ { "from": "system", "value": "Add a bang for extra safety reasons\n" }, { "from": "human", "value": "class FillInDateTransition\n def perform\n entries.find_each { |entry| set_date(entry) }\n end\n\n private\n\n def set_date(entry)\n entry.update_attribute(:date, entry.created_at.to_da...
ruby
chosen
[ { "from": "human", "value": "Add starter for skip list\n" }, { "from": "gpt", "value": "# SkipNode is the node of a skip list\n# This implementation is done using a\n# Linked List of arrays\n#\n# Author:: Tristan Claverie\n# License:: MIT\nclass SkipNode\n # An array containing the next Node\...
ruby
chosen
[ { "from": "system", "value": "Add missing field for Mongoid\n" }, { "from": "human", "value": "##\n# see active_record/impression.rb\n# same doc applies to here\nclass Impression\n include Mongoid::Document\n include Mongoid::Timestamps\n\n include Impressionist::CounterCache\n Impressionist...
ruby
chosen
[ { "from": "system", "value": "Update gem to support DataCatalog.with_key" }, { "from": "human", "value": "require 'rubygems'\nrequire 'httparty'\nrequire 'activesupport'\nrequire 'mash'\n\nmodule DataCatalog\n mattr_accessor :api_key, :base_uri\n class Error < RuntimeError;...
ruby
chosen
[ { "from": "system", "value": "Remove fingerprint check from static asset\n" }, { "from": "human", "value": "require 'sprockets/engine_pathname'\nrequire 'sprockets/utils'\nrequire 'digest/md5'\nrequire 'time'\n\nmodule Sprockets\n class StaticAsset\n attr_reader :pathname, :content_type, :mt...
ruby
chosen
[ { "from": "system", "value": "Add a warning that we're invoking old when record" }, { "from": "human", "value": "require \"suture/surgeon/observer\"\nrequire \"suture/surgeon/no_op\"\n\nmodule Suture\n class ChoosesSurgeon\n def choose(plan)\n if plan.record_calls\n Surgeon::Obse...
ruby
chosen
[ { "from": "system", "value": "Correct class name in docs\n" }, { "from": "human", "value": "#--\n# Copyright 2015 Google Inc. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You ma...
ruby
chosen
[ { "from": "system", "value": "Use same backend name, and remove reduntant use of require\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'asciidoctor'\nrequire 'asciidoctor/converter/html5'\n\nmodule Gitlab\n module Asciidoc\n class Html5Converter < (Asciidoctor::...
ruby
chosen
[ { "from": "system", "value": "Make sure slugs begin with a leading slash\n" }, { "from": "human", "value": "desc \"Delete mainstream slugs from search.\\n\nSee original documentation @ https://github.com/alphagov/wiki/wiki/Changing-GOV.UK-URLs#making-the-change\"\n\ntask :delete_mainstream_slug_...
ruby
chosen
[ { "from": "system", "value": "Add sender name and email to the emailsetting\n" }, { "from": "human", "value": "class EmailSetting < Versioneye::Model\n\n include Mongoid::Document\n include Mongoid::Timestamps\n\n field :address , type: String , default: 'email-smtp.eu-west-1.amaz...
ruby
chosen
[ { "from": "system", "value": "Use proper types in search tweets query\n" }, { "from": "human", "value": "# encoding: UTF-8\n\nrequire 'active_record'\n\nmodule Carto\n class SearchTweet < ActiveRecord::Base\n\n belongs_to :user, inverse_of: :users\n belongs_to :user_table, class_name: 'Ca...
ruby
chosen
[ { "from": "system", "value": "Generalize tests for update action\n" }, { "from": "human", "value": "shared_examples_for \"a model with an update action\" do |valid_id, changes|\n describe \"#update\" do\n it \"updates an existing object\" do\n model = nil\n original_values = nil\n\...
ruby
chosen
[ { "from": "system", "value": "Set db host as 'localhost' in deploy config\n" }, { "from": "human", "value": "puts \"*** Deploying to the \\033[1;41m PRODUCTION \\033[0m servers!\"\n\nset :domain, '219.94.232.157'\nset :db_host, domain\nrole :web, domain\nrole :app, domain\nrole :db, domain, :...
ruby
chosen
[ { "from": "human", "value": "Add final tests for archiving\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass MedicalConditionArchiveTest < ActionDispatch::IntegrationTest\n def setup\n @admin = users(:david)\n @medical_condition = medical_conditions(:one)\n log_in_as(@adm...
ruby
chosen
[ { "from": "system", "value": "Add jdk-tool plugin as its not in Jenkins 2.112\n\nSigned-off-by: Josh Barker <88d7d21fa8a250d4e915db098658a3f5a42acdfb@gmail.com>\n" }, { "from": "human", "value": "apt_update 'update' if platform_family?('debian')\n\ninclude_recipe 'java::default'\ninclude_recipe ...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary include and app method in test.\n\nThese are inherited from the IntegrationTest superclass.\n" }, { "from": "human", "value": "require \"integration_test_helper\"\nrequire \"app\"\nrequire \"rest-client\"\n\nclass ElasticsearchIndexingTest < Integ...
ruby
chosen
[ { "from": "system", "value": "Rename method for getting old Freddie\n" }, { "from": "human", "value": "require 'bundler'\nrequire 'open-uri'\n\nBundler.require\n\nrequire_relative 'config/datamapper'\nrequire_relative 'models/post'\n\ndef update_freddie(new_freddie)\n DataMapper.auto_upgrade!\n...
ruby
chosen
[ { "from": "human", "value": "Implement basic IVR system for playing Sega music\n" }, { "from": "gpt", "value": "require 'rubygems'\nrequire 'twilio-ruby'\nrequire 'sinatra'\n\nsongs = {\n '1' => 'http://gnarly.io/SpaceHarrier.mp3',\n '2' => 'http://gnarly.io/EmeraldHillZone.mp3',\n '3' ...
ruby
chosen
[ { "from": "system", "value": "[CA-3706] Change link of admin campaign iterations\n" }, { "from": "human", "value": "module Lobbyist\n module V2\n module Admin\n class CampaignIteration < Lobbyist::V2::Base\n attr_accessor :id, :communication_campaign_id, :start_date, :end_date, :...
ruby
chosen
[ { "from": "system", "value": "Add payment methods id to validation excludes\n" }, { "from": "human", "value": "module PiggybakBraintree\n module PaymentDecorator\n extend ActiveSupport::Concern\n\n included do\n attr_accessor :payment_method_nonce\n\n validates :payment_method_n...
ruby
chosen
[ { "from": "human", "value": "Add tests for model class as subject\n" }, { "from": "gpt", "value": "require File.expand_path(File.dirname(__FILE__) + \"/application/test/test_helper.rb\")\n\nclass ClassAsSubjectTest < ActiveSupport::TestCase\n fixtures :users, :widgets, :authorizations\n\n test...
ruby
chosen
[ { "from": "system", "value": "Add run! class method to EvernoteBackup for starting the backup." }, { "from": "human", "value": "#!/usr/bin/env ruby\n# evernote_backup.rb\n\nrequire \"toml\"\nrequire \"evernote_oauth\"\n\ntoken = TOML.load_file(ENV[\"HOME\"]+\"/.backups/evernote.toml\")[\"develop...
ruby
chosen
[ { "from": "system", "value": "Refactor EventsHelper and remove unused code.\n" }, { "from": "human", "value": "module EventsHelper\n\n def make_event_split_id_array(event_id, splits)\n event_split_id_array = []\n splits.each do |split|\n @event_split = AidStation.find_by(event_id: ev...
ruby
chosen
[ { "from": "system", "value": "Update for new Bootstrap Frontend in Spree 3.0.0.beta\n" }, { "from": "human", "value": "module Spree::Conekta\n class PaymentsController < Spree::StoreController\n helper Spree::OrdersHelper\n ssl_required\n skip_before_filter :verify_authenticity_token, ...
ruby
chosen
[ { "from": "system", "value": "[rubocop] C: Move items.delete_all out of the conditional.\n" }, { "from": "human", "value": "class Webmail::CacheSettingsController < ApplicationController\n include Webmail::BaseFilter\n\n menu_view false\n\n private\n\n def set_crumbs\n @crumbs << [t(\"web...
ruby
chosen
[ { "from": "system", "value": "Update visually hidden text to share links\n\nThe default hidden text is \"Share on\" which is good in most cases but\non government organisation pages the component is used as social links,\nso that text doesn't make sense.\n\nThis updates it to \"Follow on\"\n" }, { "...
ruby
chosen
[ { "from": "system", "value": "Add spec for circular references in IceNine::Freezer::Range.deep_freeze\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\nrequire 'ice_nine'\n\ndescribe IceNine::Freezer::Range, '.deep_freeze' do\n subject { object.deep_freeze(value) }\...
ruby
chosen
[ { "from": "system", "value": "Add missing `fields` param to AccountsController\n" }, { "from": "human", "value": "module Spree\n module Api\n module V2\n module Storefront\n class AccountController < ::Spree::Api::V2::BaseController\n def show\n raise ActiveRe...
ruby
chosen
[ { "from": "system", "value": "Fix integrations tests for device-init package\n\nSigned-off-by: Dieter Reuter <554783fc552b5b2a46dd3d7d7b9b2cce9a82c122@me.com>\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe package('device-init') do\n it { should be_installed }\nend\n\ndesc...
ruby
chosen
[ { "from": "system", "value": "JariBakken: Make sure we kill the browser if the initial connection fails.\n\ngit-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@17860 07704840-8298-11de-bf8c-fd130f914ac9\n" }, { "from": "human", "value": "module Selenium\n module WebDriver\n module Firefox\n...
ruby
chosen
[ { "from": "system", "value": "Test activerecord rc2 instead of beta4." }, { "from": "human", "value": "require 'ginger'\n \ndef create_scenario(version)\n scenario = Ginger::Scenario.new(\"Rails #{version}\")\n scenario[/^active_?record$/] = version\n scenario[/^active_?support$/] = version\n...
ruby
chosen
[ { "from": "system", "value": "Add method to generate a hash from array to be used in converting model names, events, and actors to filter hashes\n" }, { "from": "human", "value": "require 'will_paginate/array'\nrequire 'yaml'\nrequire_dependency \"paper_trail_ui/application_controller\"\n\nmodul...
ruby
chosen
[ { "from": "system", "value": "Change digest for shipwire signature\n" }, { "from": "human", "value": "module Spree\n class ShipwireWebhookController < ActionController::Base\n respond_to :json\n\n before_action :validate_key, except: :subscribe\n\n def subscribe\n if exists_in_pos...
ruby
chosen
[ { "from": "system", "value": "Simplify loop & counting invites" }, { "from": "human", "value": "class Task::Notifications::InvitationEmail < Mutations::Command\n required do\n model :task\n model :current_user, class: User\n string :type\n end\n\n def execute\n invite_count = 0\n ...
ruby
chosen
[ { "from": "system", "value": "Set max age to 30 days\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nFastlyRails.configure do |c|\n # Fastly api key, required\n c.api_key = ENV.fetch(\"FASTLY_API_KEY\")\n # time in seconds, optional, defaults to 2592000 (30 days)\n c.max_...
ruby
chosen
[ { "from": "system", "value": "Put the test execution code inside included, so that the tests will be run whenever the module is included.\n" }, { "from": "human", "value": "require 'mixlib/shellout'\n\nmodule RSpec\n module KnifeTestUtils\n subject { knife_run }\n let(:knife_run) { run co...
ruby
chosen
[ { "from": "system", "value": "Fix displaying of first line in legacy parser for undocumentable error\n" }, { "from": "human", "value": "module YARD\n module Parser::Ruby::Legacy\n class Statement \n attr_reader :tokens, :comments, :block\n attr_accessor :comments_range, :group\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add configured domain host to rails hosts config\n" }, { "from": "human", "value": "server_options = Settings.domain\nserver_options = case server_options\nwhen String\n uri = URI.parse(server_options)\n { host: uri.host, port: uri.port, protocol: uri.scheme }\nwh...
ruby
chosen
[ { "from": "system", "value": "Fix test/unpack_strategy/zstd for Ubuntu 22.04\n" }, { "from": "human", "value": "# typed: false\n# frozen_string_literal: true\n\nrequire_relative \"shared_examples\"\n\ndescribe UnpackStrategy::Zstd do\n let(:path) { TEST_FIXTURE_DIR/\"cask/container.tar.zst\" }\...
ruby
chosen
[ { "from": "system", "value": "Fix TypeError in Vcard class reference\n" }, { "from": "human", "value": "module HasVcards\n module Vcard\n module DirectoryAddress\n def to_vcard\n Vcard.new(\n given_name: first_name,\n family_name: family_name,\n street_...
ruby
chosen
[ { "from": "system", "value": "Allow reselect for nodes in TreeBuilderContainersFilter\n" }, { "from": "human", "value": "class TreeBuilderContainersFilter < TreeBuilder\n private\n\n def tree_init_options(_)\n {\n :leaf => \"Container\",\n :full_ids => true\n }\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix unit tests on Puppet4\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'openldap::server::globalconf' do\n\n let(:title) { 'foo' }\n\n on_supported_os.each do |os, facts|\n context \"on #{os}\" do\n let(:facts) do\n facts\n ...
ruby
chosen
[ { "from": "system", "value": "Use named route instead of string literal\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'active_model_serializers'\n\ndescribe 'Creating models remotely' do\n before do\n RemoteFactoryGirlHomeRails.configure do |config|\n config.skip_bef...
ruby
chosen
[ { "from": "system", "value": "Fix problem with oracle (add size for varchar2)\n" }, { "from": "human", "value": "AjaxDatatablesRails.configure do |config|\n # available options for db_adapter are: :pg, :mysql2, :sqlite3\n # config.db_adapter = :pg\n\n # available options for paginator are: :s...
ruby
chosen
[ { "from": "system", "value": "Allow configuration of multiple actions at the same time\n\nfor_action is now aliased as for_actions, and both accept multiple\nactions to configure using the same block. Fixes #23.\n" }, { "from": "human", "value": "module Arrthorizer\n module Rails\n class Con...
ruby
chosen
[ { "from": "system", "value": "Add support for ID to suggested change search\n" }, { "from": "human", "value": "module AdvancedSearches\n class SuggestedChange\n include Base\n\n def initialize(params)\n @params = params\n @presentation_class = SuggestedChangePresenter\n end\n...
ruby
chosen
[ { "from": "system", "value": "Make order and distributor report resilient to orders without distributors\n" }, { "from": "human", "value": "\nmodule OpenFoodWeb\n class OrderAndDistributorReport\n\n def initialize orders\n @orders = orders\n end\n\n def header\n [\"Order date...
ruby
chosen
[ { "from": "system", "value": "Update Fatality Notice sync check\n\nThe Fatality Notice sync check now checks for government-frontend\nas the rendering app.\n" }, { "from": "human", "value": "module SyncChecker\n module Formats\n class FatalityNoticeCheck < EditionBase\n def root_path\n ...
ruby
chosen
[ { "from": "system", "value": "Clean up puts for debugging\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'time'\nrequire 'digest'\nrequire 'base64'\nrequire 'securerandom'\nrequire 'openssl'\n# require 'uri'\n\nrequire 'cgi'\n\n# @private\nmodule Aliyun::Openapi::Faraday\n # @pri...
ruby
chosen
[ { "from": "system", "value": "Remove button styling from lists\n" }, { "from": "human", "value": "module DisplayFor\n module Builder\n class CollectionBase < Base\n attr_reader :collection\n \n def initialize(resource_class, collection, template, &block)\n @collection =...
ruby
chosen
[ { "from": "system", "value": "Remove warning from simple form\n" }, { "from": "human", "value": "require \"simple_form/inputs/base\"\n\nclass TokenInput < SimpleForm::Inputs::Base\n #\n # one:\n # <%= f.input :category_id, :as => :token %>\n #\n # many:\n # <%= f.input :category_ids, :as =...
ruby
chosen
[ { "from": "system", "value": "Add UNICORN_WORKER_PROCESSES to config as this can vary\n" }, { "from": "human", "value": "# Load the system-wide standard Unicorn file\ndef load_file_if_exists(config, file)\n config.instance_eval(File.read(file)) if File.exist?(file)\nend\nload_file_if_exists(sel...
ruby
chosen
[ { "from": "system", "value": "Remove before hook since it's only one spec using it." }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe GroupsController do\n\n let(:group) { Fabricate(:group) }\n\n describe 'when one exists' do\n render_views\n\n before(:each) do\n @r...
ruby
chosen
[ { "from": "system", "value": "Make latest migration postgres compatible\n" }, { "from": "human", "value": "class AddIdentifierToExistingInvitations < ActiveRecord::Migration\n def self.up\n execute <<SQL\n UPDATE invitations\n SET invitations.identifier = (SELECT users.invitation_ide...
ruby
chosen
[ { "from": "system", "value": "Optimize build fail types, feedback via @taquitos\n" }, { "from": "human", "value": "module FastlaneCI\n # Represents a single \"Row\" when streaming the build output (might be coming from fastlane)\n # meaning it's a single message that we want to show to the use...
ruby
chosen
[ { "from": "system", "value": "Remove a superfluous transport test.\n" }, { "from": "human", "value": "RSpec.describe NanomsgTransport do\n let(:host) { 'tcp://127.0.0.1:6000' }\n let(:message) { SecureRandom.hex }\n\n it 'should work' do\n server = NanomsgTransport.server(host) { |rec| @re...
ruby
chosen
[ { "from": "system", "value": "Remove the workaround for already fixed Rails bug\n" }, { "from": "human", "value": "require 'active_record'\nrequire 'globalize3'\n\nmodule EasyGlobalize3Accessors\n\n def globalize_accessors(options = {})\n # Temporary workaround for bug: https://rails.lightho...
ruby
chosen
[ { "from": "system", "value": "Use respond_to?(:before_filter) to make it Rails version agnostic\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n\nmodule Mongoid\nmodule Userstamp\n\n class Railtie < Rails::Railtie\n\n # Include Mongoid::Userstamp::User into User class, if not ...
ruby
chosen
[ { "from": "system", "value": "Use before_action instead of before_filter\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\n\nmodule Mongoid\nmodule Userstamp\n\n class Railtie < Rails::Railtie\n\n # Include Mongoid::Userstamp::User into User class, if not already done\n confi...
ruby
chosen
[ { "from": "system", "value": "Fix pluralization error in ActivitiesHelper spec\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../spec_helper'\n\ndescribe ActivitiesHelper do\n \n #Delete this example and add some real ones or delete this file\n it \"should include the A...
ruby
chosen
[ { "from": "human", "value": "Test the search function of ContentNodeValue\n" }, { "from": "gpt", "value": "require File.dirname(__FILE__) + \"/../spec_helper\"\n\n\ndescribe ContentNodeValue do\n\n @@paragraph_body = <<-EOF\n<h1>Title the page</h1>\n<p>\nSome additional stuff<br/>\n<b>Bolded!</...
ruby
chosen
[ { "from": "system", "value": "Fix ActionView::Template::Error in web-console, caused by e0c2731d\n\nAdding controller check before accesing params. Fixes #194\n" }, { "from": "human", "value": "module Remotipart\n module RequestHelper\n def remotipart_submitted?\n params[:remotipart_sub...
ruby
chosen
[ { "from": "system", "value": "Test if the label is valid before creating link\n" }, { "from": "human", "value": "class MigrateTaggableLabels < ActiveRecord::Migration\n def up\n taggings = ActsAsTaggableOn::Tagging.where(taggable_type: ['Issue', 'MergeRequest'], context: 'labels')\n taggi...
ruby
chosen
[ { "from": "system", "value": "Change position of several methods that require overriding for readability.\n" }, { "from": "human", "value": "module Servitude\n module ServerThreaded\n\n def self.included( base )\n base.class_eval do\n after_initialize :initialize_thread\n en...
ruby
chosen
[ { "from": "system", "value": "Update github repo after admin edit" }, { "from": "human", "value": "class Admin::ProjectsController < Admin::ApplicationController\n def show\n @project = Project.find(params[:id])\n end\n\n def update\n @project = Project.find(params[:id])\n if @projec...
ruby
chosen
[ { "from": "system", "value": "Include the Job ID in our Rails Sidekiq logging\n\nWith the change to verbose:false in sidekiq the arguments of a job are\nnot stored in the Sidekiq log. They are however stored in our Rails log\nand adding this job id field allows us to glue these together.\n" }, { "fr...
ruby
chosen
[ { "from": "system", "value": "Make the initializer in the initializers folder work.\n" }, { "from": "human", "value": "module Spree::ProductZoom; end\n\nmodule SpreeProductZoom\n class Engine < Rails::Engine\n require 'spree/core'\n isolate_namespace Spree\n engine_name 'spree_product_...
ruby
chosen
[ { "from": "system", "value": "Update selenium.yml to saucelabs-adapter 0.7.0 syntax.\n\nAlso delete problematic attempt to nuke rake task selenium:server before defining it.\n" }, { "from": "human", "value": "require 'run_utils'\n\nnamespace :selenium do\n\n# Rake::Task[:'selenium:server'].clea...
ruby
chosen
[ { "from": "system", "value": "Fix Autotag::List (was using configuration hash)\n" }, { "from": "human", "value": "module Thrust\n module Tasks\n module Autotag\n class List\n def initialize(git = Thrust::Git.new)\n @git = git\n end\n\n def run(thrust)\n ...
ruby
chosen
[ { "from": "human", "value": "Add starred and links columns to quotes db\n" }, { "from": "gpt", "value": "Sequel.migration do\n up do\n add_column :quotes, :starred, TrueClass\n add_column :quotes, :links, String, :text => true\n\n end\n\n down do\n drop_column :quotes, :starred\n ...
ruby
chosen
[ { "from": "system", "value": "Change post active/statusable scope comment to read published\n" }, { "from": "human", "value": "<% module_namespacing do -%>\nclass <%= plural_name.camelize %>Controller < ForestController\n before_action :set_<%= singular_name %>, only: [:show]\n\n def index\n ...
ruby
chosen
[ { "from": "system", "value": "Handle next parameter and more closely model restful_auth\n" }, { "from": "human", "value": "module FacebookerAuthentication\n module Controller\n def self.included(includer)\n #install the current_user helper and the before filter\n includer.module_ev...
ruby
chosen
[ { "from": "system", "value": "Refresh issue / show page to verify attachments\n" }, { "from": "human", "value": "module QA\n describe 'creates issue', :smoke do\n let(:issue_title) { 'issue title' }\n\n def create_issue\n Runtime::Browser.visit(:gitlab, Page::Main::Login)\n Page...
ruby
chosen
[ { "from": "system", "value": "Add genitive function for russian lang.\n" }, { "from": "human", "value": "require 'devise'\nrequire 'bootstrap-sass'\nrequire 'font-awesome-sass-rails'\nrequire 'constructor_core/engine'\n\nclass String\n def numeric?\n return true if self =~ /^\\d+$/\n true...
ruby
chosen
[ { "from": "system", "value": "Add missing routes to authorization routing spec\n" }, { "from": "human", "value": "require \"spec_helper\"\n\nmodule Roper\n describe AuthorizationController do\n describe \"routing\" do\n routes { Roper::Engine.routes }\n\n it \"routes to #authorize\...
ruby
chosen
[ { "from": "system", "value": "Test that the service standard conforms to its schema\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe ServiceStandardPresenter, \"#content_id\" do\n it \"returns a preassigned UUID\" do\n expect(\n described_class.new.content_i...
ruby
chosen
[ { "from": "human", "value": "Add test for form data assembly." }, { "from": "gpt", "value": "require \"test_helper\"\n\ndescribe S3Relay::UploadPresigner do\n before do\n S3Relay::UploadPresigner.any_instance.stubs(:access_key_id)\n .returns(\"access-key-id\")\n S3Relay::UploadPresig...
ruby
chosen
[ { "from": "system", "value": "Fix bug when domain not present on an operator\n" }, { "from": "human", "value": "require_relative 'query_modifier'\n\nmodule ConceptQL\n module QueryModifiers\n class DrugQueryModifier < QueryModifier\n attr :db\n\n def initialize(*args)\n supe...
ruby
chosen
[ { "from": "human", "value": "Update search index for new policy-groups\n\nRemove the old data from the index and then add the new data. The old\nurls have to be hard-coded because the rails routes for the old urls has\nalready been deleted.\n" }, { "from": "gpt", "value": "PolicyGroup.all.each d...
ruby
chosen
[ { "from": "system", "value": "Make Feeder::Item act as votable" }, { "from": "human", "value": "module Feeder\n module Concerns::Models::Item\n extend ActiveSupport::Concern\n\n included do\n include Feeder::Concerns::Helpers::Filter\n\n scope :unblocked, -> { where blocked: fal...
ruby
chosen
[ { "from": "system", "value": "Fix missing case for memory\n" }, { "from": "human", "value": "module GenesisCollector\n module DmiDecode\n\n def get_dmi_data\n @dmi_data ||= parse_dmidecode(shellout_with_timeout('dmidecode --type processor --type memory'))\n end\n\n def parse_dmide...
ruby
chosen
[ { "from": "system", "value": "Revert \"Dont worry about ratio yet\"\n\nThis reverts commit acfecb6380864fc3df2c96409ee9ccd82e4a3765.\n\nConflicts:\n\ttrends.rb\n" }, { "from": "human", "value": "require 'json'\nrequire 'csv'\n\n######### Define arguments #########\n\nINPUT = \"data/cleaned.json\...
ruby
chosen
[ { "from": "system", "value": "Store the component on the instance\n\nWe already own the component so we don't need to ask for it again\n" }, { "from": "human", "value": "module SimpleForm\n module Wrappers\n # `Single` is an optimization for a wrapper that has only one component.\n class ...
ruby
chosen
[ { "from": "system", "value": "Add GroupMissingChildError and InvalidHostTypeError classes\nand add docstrings to all error classes\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule VagrantPlugins\n module AnsibleAuto\n module Errors\n class InventoryError < Vagran...
ruby
chosen