conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "REmove commented out code setting all schools to @school\n" }, { "from": "human", "value": "class SchoolsController < ApplicationController\n\t# skip_before_action :verify_authenticity_token\n\tdef index\n\t\t# @schools = School.all\n\t\tgon.schools = School.all\n\t...
ruby
chosen
[ { "from": "system", "value": "Make response from upload an array\n" }, { "from": "human", "value": "class UploadsController < ApplicationController\n def upload\n \tfile = params[:files].first\n \tresponse = Upload.store(file.tempfile)\n \trespond_to do |format|\n format.html { render :...
ruby
chosen
[ { "from": "system", "value": "Update the number of symbols in the ontology\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass OntologyParser::ComplexTest < ActiveSupport::TestCase\n \n context \"OntologyParser\" do\n \n context 'parsing distributed XML' do\n setup do\...
ruby
chosen
[ { "from": "system", "value": "JariBakken: Enable double/context click specs for IE.\n\ngit-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@13526 07704840-8298-11de-bf8c-fd130f914ac9\n" }, { "from": "human", "value": "require File.expand_path(\"../spec_helper\", __FILE__)\n\nmodule Selenium\n m...
ruby
chosen
[ { "from": "system", "value": "Use delayed_job for archive downloading\n" }, { "from": "human", "value": "class AccountsController < ApplicationController\n def new\n end\n\n def create\n auth = env[\"omniauth.auth\"]\n @account = Account.find_or_initialize_by(uid: auth[\"uid\"])\n @a...
ruby
chosen
[ { "from": "system", "value": "Check if user is logged in before executing certain actions\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n before_action :set_comment, only: [:show, :edit, :update, :destroy]\n\n # do we need this?\n # def index\n # @comm...
ruby
chosen
[ { "from": "system", "value": "r1901: Access control for job task restart/destroy\n\n--HG--\nbranch : moe\nextra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%40279\n" }, { "from": "human", "value": "class JobTaskController < ApplicationController\n layout \"default\"...
ruby
chosen
[ { "from": "system", "value": "Add correct has_secure_password implementation of sessions with Rails 4 and the latest Bcrypt gem methods.\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def new\n end\n\n # def create\n # user = User.find_by_email(para...
ruby
chosen
[ { "from": "system", "value": "Add extra if statement so mailchimp doesn't get pissed off.\n" }, { "from": "human", "value": "class WebhooksController < ApplicationController\n def mailchimp\n user = User.find_by(email: params[:data][:email])\n\n if user\n user.update_column(is_subscr...
ruby
chosen
[ { "from": "system", "value": "Remove unused module include from custom user generator\n\nThis include exists since this generator was introduced but no method is ever called on that module.\n" }, { "from": "human", "value": "require 'rails/generators/active_record/migration'\n\nmodule Spree\n c...
ruby
chosen
[ { "from": "system", "value": "Switch status code and response body by validation result\n" }, { "from": "human", "value": "# Copyright 2014 TIS inc.\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 ...
ruby
chosen
[ { "from": "system", "value": "Add test for \"-ku, -mu, -nya\" suffixes\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Sastrawi do\n it 'has a version number' do\n expect(Sastrawi::VERSION).not_to be nil\n end\n\n it 'should not stem short words' do\n short_words = ...
ruby
chosen
[ { "from": "system", "value": "Add spree_core as a dependency\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"spree_temando/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\...
ruby
chosen
[ { "from": "system", "value": "Fix assertion for Ruby 1.8 which doesn't ship MiniTest\n" }, { "from": "human", "value": "require 'test_helper'\n\nmodule FormForms\n class FormRegistryTest < ActionView::TestCase\n test \"set, get, and delete registered form\" do\n assert_nil FormRegistry[...
ruby
chosen
[ { "from": "human", "value": "Add return code integration tests\n" }, { "from": "gpt", "value": "require_relative '../test_helper'\n\n# NOTE: These tests depend on the OpenLDAP retcode overlay.\n# See: section 12.12 http://www.openldap.org/doc/admin24/overlays.html\n\nclass TestReturnCodeIntegrat...
ruby
chosen
[ { "from": "human", "value": "Add a middleware manager spec\n\n\n(transferred from ManageIQ/manageiq@157973577dbd2e7db105e305e25f5ff408907bbd)\n" }, { "from": "gpt", "value": "describe ManageIQ::Providers::Hawkular::MiddlewareManager do\n it \".ems_type\" do\n expect(described_class.ems_type)...
ruby
chosen
[ { "from": "system", "value": "Fix resource for OAuth for Devel portal\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'three_scale_api/resources/default'\nmodule ThreeScaleApi\n module Resources\n # WebHook resource wrapper for the WebHook entity received by the R...
ruby
chosen
[ { "from": "system", "value": "Add id attribute to material serializer\n" }, { "from": "human", "value": "class MaterialSerializer < ActiveModel::Serializer\n attributes(\n :original_link,\n :caption_original,\n :caption_translated,\n :annotation_original,\n :annotation_translated...
ruby
chosen
[ { "from": "system", "value": "Test that sandbox complains correctly\n\nTest that sandbox does not complain about bogus .pyc errors and does\ncomplain about other failures.\n\nCloses #684.\n" }, { "from": "human", "value": "require \"testing_env\"\nrequire \"sandbox\"\n\nclass SandboxTest < Homeb...
ruby
chosen
[ { "from": "system", "value": "Upgrade IntelliJ IDEA to 15.0.1.\n" }, { "from": "human", "value": "cask :v1 => 'intellij-idea' do\n version '15.0'\n sha256 'a195493e2c4a1b55f76d9784ef2d8815bffb46d6b4a1b11a8000489a011097b6'\n\n url \"https://download.jetbrains.com/idea/ideaIU-#{version}-custom-...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.0 to 0.1.1\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'virtual'\n s.version = '0.1.0'\n s.summary = 'Virtual method declaration'\n s.description = ' '\n\n s.author...
ruby
chosen
[ { "from": "human", "value": "Add bench mark for keywords class exec\n" }, { "from": "gpt", "value": "require 'benchmark/ips'\nrequire 'rspec/support'\nrequire 'rspec/support/with_keywords_when_needed'\n\nKlass = Class.new do\n def test(*args, **kwargs)\n end\nend\n\ndef class_exec_args\n Klas...
ruby
chosen
[ { "from": "system", "value": "Fix ampersands in link_header helper\n" }, { "from": "human", "value": "module ApplicationHelper\n \n # Returns the full title on a per-page basis.\n def full_title(page_title = '')\n base_title = \"Paul Bogard’s Portfolio\"\n if page_title.empty?\n ba...
ruby
chosen
[ { "from": "system", "value": "Revert \"select option label can now specify a proc.\"\n\nThis reverts commit 66adcf11ab5a5a55777f41fb6e29badd04e7509f.\n" }, { "from": "human", "value": "module SwitchUserHelper\n class SelectOption < Struct.new(:label, :scope_id); end\n def switch_user_select\n ...
ruby
chosen
[ { "from": "system", "value": "Update MR title change icon\n" }, { "from": "human", "value": "module SystemNoteHelper\n ICON_NAMES_BY_ACTION = {\n 'commit' => 'icon_commit',\n 'merge' => 'icon_merge',\n 'merged' => 'icon_merged',\n 'opened' => 'icon_status_open',\n 'closed' => 'ic...
ruby
chosen
[ { "from": "system", "value": "Change the sudo recipe so it doesn't try to do an upgrade on every run. This takes forever on CentOS\n\n\nFormer-commit-id: bf91f36cda6822d668e733832811ad3305067aea [formerly 7f6332604b3c3657d74ac86ae38a0a03f392ed59] [formerly 9aa9e35ec4bd39dfde0f4f71b80ab66b064d17b5 [formerly...
ruby
chosen
[ { "from": "system", "value": "Add blather, rspec and guard dependencies.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/roboter/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Bernd Ahlers\"]\n gem.email = ...
ruby
chosen
[ { "from": "system", "value": "Move to newer RSpec matcher syntax\n" }, { "from": "human", "value": "require 'rspec/expectations'\n\nmodule Arrthorizer\n module RSpec\n module Matchers\n module Roles\n class AppliesToUser\n def initialize(user)\n @user = user\n...
ruby
chosen
[ { "from": "system", "value": "Update podspec to include bubble-wrap bundled style\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = 'Mapzen-ios-sdk'\n s.version = '0.1.0'\n\n s.summary = 'Mapzen iOS SDK'\n s.description = 'The Mapzen iOS SDK is a thin wr...
ruby
chosen
[ { "from": "system", "value": "Add page properties in analytics\n" }, { "from": "human", "value": "module V1\n class AnalyticsController < ApplicationController\n SEGMENT_WRITE_KEY = Rails.application.secrets.segment_write_key\n\n def identify\n segment(:identify, %w(user_id traits))\...
ruby
chosen
[ { "from": "system", "value": "Make dropbox image matching more strict" }, { "from": "human", "value": "module Onebox\n module Engine\n class ImageOnebox\n include Engine\n\n matches_regexp /^(https?:)?\\/\\/.+\\.(png|jpg|jpeg|gif|bmp|tif|tiff)(\\?.*)?$/i\n\n def to_html\n ...
ruby
chosen
[ { "from": "system", "value": "Fix error in updating existing user invites\n" }, { "from": "human", "value": "class AddUsedColumnToUserInvitations < ActiveRecord::Migration\n def change\n transaction do\n add_column :user_invitations, :used, :boolean, default: false\n\n uis = UserIn...
ruby
chosen
[ { "from": "system", "value": "Fix bug; mistake same prefix project name\n" }, { "from": "human", "value": "module Ruboty\n module Gitlab\n module Actions\n class Base\n NAMESPACE = \"gitlab\"\n\n attr_reader :message\n\n def initialize(message)\n @message =...
ruby
chosen
[ { "from": "system", "value": "Include :service_templates to remove N+1 query\n\nservice_templates is loaded here:\nhttps://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/presenters/tree_builder_service_catalog.rb#L35\n" }, { "from": "human", "value": "class TreeBuilderServiceCatalog < T...
ruby
chosen
[ { "from": "system", "value": "Return nil on not found.\n" }, { "from": "human", "value": "# Copyright (c) 2015, Regents of the University of Michigan.\n# All rights reserved. See LICENSE.txt for details.\n\nmodule Spectrum\n module Config\n class FieldList < ConfigList\n CONTAINS = Fiel...
ruby
chosen
[ { "from": "system", "value": "Update podspec for 1.1 release\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint PINRemoteImage.podspec' to ensure this is a\n# valid spec and remove all comments before submitting the spec.\n#\n# Any lines starting with a # are optional, but enco...
ruby
chosen
[ { "from": "system", "value": "Add ruby >=2.5.0 required min version\n" }, { "from": "human", "value": "Gem::Specification.new do |spec|\n spec.name = \"jekyll-agency\"\n spec.version = \"1.0.7\"\n spec.authors = [\"Ravi Riley\"]\n\n spec.summary = \"Bootstrap Agenc...
ruby
chosen
[ { "from": "system", "value": "Remove ancestry from dev gems\n" }, { "from": "human", "value": "$:.push File.expand_path('../lib', __FILE__)\n\n# Maintain your gem's version:\nrequire 'seo_cms/version'\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.name ...
ruby
chosen
[ { "from": "system", "value": "Update Charles to version 3.11\n" }, { "from": "human", "value": "cask :v1 => 'charles' do\n version '3.10.2'\n sha256 'd68be46d7dc9654b4b3b094a2f451226376d7bf3c5d401aecba082b27e0b8b6a'\n\n url \"http://www.charlesproxy.com/assets/release/#{version}/charles-proxy...
ruby
chosen
[ { "from": "system", "value": "Use default attributes which allows for easier overriding" }, { "from": "human", "value": "module Sprangular\n class TaxonSerializer < BaseSerializer\n attributes :id, :name, :pretty_name, :permalink, :parent_id, :taxonomy_id\n\n has_many :children, key: :tax...
ruby
chosen
[ { "from": "system", "value": "Make sure we're passing a string to File methods.\n" }, { "from": "human", "value": "module Vim\n\n module ImprovedBuffer\n\n def [] key\n if key.is_a? Range\n if key.end < 0\n key = key.begin .. self.count - (key.end + 1).abs \n end\...
ruby
chosen
[ { "from": "system", "value": "Fix problem with empty stdout/stderr answer for shell magent\n\nChange-Id: I76e2c984bf86aa0df3ec1762df52cb1533ad7665\nCloses-Bug: #1322475\n" }, { "from": "human", "value": "# -*- coding: utf-8 -*-\n\n# Copyright 2013 Mirantis, Inc.\n#\n# Licensed under the Ap...
ruby
chosen
[ { "from": "system", "value": "Remove an incorrect endpoint test\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Battlenet::Client do\n context \"when special characters are in realm names\" do\n before do\n Battlenet.configure do |config|\n config.api_key = E...
ruby
chosen
[ { "from": "system", "value": "Add method_missing test for Bsf::Database class\n\nAdd a test to make sure method_missing is working as intended.\n\nTo do this call a method that should exist on an instance of\nthe Sequel::SQLite::Database class and check that the return\nvalue is what we would expect from th...
ruby
chosen
[ { "from": "system", "value": "Improve test suite for ruby:robot-name\n" }, { "from": "human", "value": "require 'minitest/autorun'\nrequire 'minitest/pride'\nrequire_relative 'robot'\n\nclass RobotTest < MiniTest::Unit::TestCase\n def test_has_name\n assert_match /\\w{2}\\d{3}/, Robot.new.na...
ruby
chosen
[ { "from": "system", "value": "Fix specs on Rails 5.2\n" }, { "from": "human", "value": "ActiveRecord::Migration.verbose = false\n\nActiveRecord::Migrator.migrate(File.expand_path('../../rails_app/db/migrate/', __FILE__))\n" }, { "from": "gpt", "value": "ActiveRecord::Migration.verbos...
ruby
chosen
[ { "from": "human", "value": "Add test to ensure `Zap` does not have an `uninstall_phase`.\n" }, { "from": "gpt", "value": "require \"spec_helper\"\n\ndescribe Hbc::Artifact::Zap do\n let(:cask) { Hbc::CaskLoader.load_from_file(TEST_FIXTURE_DIR/\"cask/Casks/with-installable.rb\") }\n\n let(:zap...
ruby
chosen
[ { "from": "system", "value": "Use page object and corresponding matchers rather than looking at URL\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.feature 'Dashboard', type: :feature do\n scenario 'Guests are asked to log in first' do\n visit dashboards_show_path\n\n e...
ruby
chosen
[ { "from": "system", "value": "Update fact testing to use rspec-mock\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'Facter::Util::Fact' do\n before(:each) do\n Facter.clear\n Facter.fact(:kernel).stubs(:value).returns('Linux')\n end\n\n after(:each) do\n Facter....
ruby
chosen
[ { "from": "system", "value": "Remove unused method and require\n" }, { "from": "human", "value": "require 'bosh/dev/build_from_spec'\nrequire 'bosh/dev/stemcell_builder_options'\nrequire 'bosh/dev/gems_generator'\nrequire 'bosh/dev/micro_bosh_release'\n\nmodule Bosh::Dev\n class StemcellRakeMet...
ruby
chosen
[ { "from": "system", "value": "Define show action for articles controller\n" }, { "from": "human", "value": "class ArticlesController < ApplicationController\n #Prefix verb URI Pattern Controller#Action \n #articles GET /articles(.:format) articles#index\n\n def index \n @art...
ruby
chosen
[ { "from": "system", "value": "Implement login in and out by storing the user_id in the session.\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n def new\n end\n\n def create\n end\n\n def destroy\n end\nend\n" }, { "from": "gpt", "value": "c...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for Comma Chameleon.\n" }, { "from": "human", "value": "cask 'comma-chameleon' do\n version '0.4.0'\n sha256 '63d39758bad01bc439b55f53d377121e3d0e6159aef4551058d311033ee49bd8'\n\n url \"https://github.com/theodi/comma-chameleon/releases/d...
ruby
chosen
[ { "from": "system", "value": "Add unit tests or setting\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass SettingTest < ActiveSupport::TestCase\n # test \"the truth\" do\n # assert true\n # end\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescri...
ruby
chosen
[ { "from": "system", "value": "Add the readme and license files to the gem" }, { "from": "human", "value": "# encoding: utf-8\n\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'sponges/version'\n\nGem::Specification.new do |s|\n s.name = \"sponges\"\n s.version = Sponge...
ruby
chosen
[ { "from": "system", "value": "Add specs for pretty print JSON\n\nThey only check that the response includes `\\n`, which should not happen\notherwise.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Travis::Api::App::Endpoint::Builds do\n it 'has to be tested'\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Add N/A default profile for missing person profiles\n" }, { "from": "human", "value": "class PersonDecorator < Draper::Decorator\n def id\n object[\"id\"]\n end\n\n def name\n object[\"name\"]\n end\n\n def adult\n object[\"adult\"]\n end\n\n def pop...
ruby
chosen
[ { "from": "system", "value": "Add homepage URL to the gemspec\n\nBy this change:\n\n1. Users can jump to this repository on GitHub from rubygems.org\n2. Maybe users can jump to this repository on GitHub from deppbot\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../l...
ruby
chosen
[ { "from": "system", "value": "Upgrade ACTPrinter for Mac.app to v3.2.2\n" }, { "from": "human", "value": "cask :v1 => 'actprinter' do\n version '3.2.1'\n sha256 '979768faafd99b5714d3397ef7dd29ff085b3f7c7aac59ea6c96c4f15f0ceb6d'\n\n # actprinter.com is the official download host per the vendor...
ruby
chosen
[ { "from": "system", "value": "Customize client_side_validation gem by changed\n\n‘validation_hash[attr] => validation_hash[attr.to_sym]’\n<< due to value of option_hash return 'Symbol', meanwhile value of validation_hash return 'String'>>" }, { "from": "human", "value": "# ClientSideValidations ...
ruby
chosen
[ { "from": "system", "value": "Use schema gem to find schemas\n" }, { "from": "human", "value": "require 'json-schema'\n\nclass SchemaValidator\n attr_reader :errors\n\n def initialize(type:, schema_name: nil, schema: nil)\n @errors = []\n @type = type\n @schema = schema\n @schema_n...
ruby
chosen
[ { "from": "system", "value": "Fix issue where TravisBuildKiller blows up when manageiq repo is missing.\n" }, { "from": "human", "value": "class TravisBuildKiller\n include Sidekiq::Worker\n include Sidetiq::Schedulable\n include MiqToolsServices::SidekiqWorkerMixin\n sidekiq_options :queue ...
ruby
chosen
[ { "from": "system", "value": "Add test for sending an sms\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'foo' do\n it 'foo' do\n expect(true).to be_true\n end\nend\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'admin visits new notific...
ruby
chosen
[ { "from": "system", "value": "Fix request spec for header id attributes\n\nAdded the id attributes to the headings in html so we can link directly\nto section, this spec was updated to include the section name.\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe \"Pages\"...
ruby
chosen
[ { "from": "system", "value": "Make create_test_files use correct path expansion\n" }, { "from": "human", "value": "require 'fileutils'\n\nRSpec.shared_context 'uses aruba API' do\n def random_string(options = {})\n options[:prefix].to_s + SecureRandom.hex + options[:suffix].to_s\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add doc region showing connecting to MySQL database\n" }, { "from": "human", "value": "# Copyright 2016 Google, Inc\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 may...
ruby
chosen
[ { "from": "system", "value": "Fix lint errors in tests.\n" }, { "from": "human", "value": "require 'spec_helper'\n\nclass Convection::Model::Template::Resource\n describe EFSFileSystem do\n subject do\n parent = double(:template)\n allow(parent).to receive(:template).and_return(par...
ruby
chosen
[ { "from": "system", "value": "Add communications role for messages\n" }, { "from": "human", "value": "require \"georgia_mailer/engine\"\n\nmodule GeorgiaMailer\n\n # Helper to turn off email notifications\n mattr_accessor :turn_on_email_notifications\n @@turn_on_email_notifications = true\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix TypeError raised by ActiveSupport::SafeBuffer\n" }, { "from": "human", "value": "module Grease\n class Adapter\n def initialize(engine)\n @engine = engine\n end\n\n def call(input)\n context = input[:environment].context_class.new(input)\n ...
ruby
chosen
[ { "from": "system", "value": "Update rails restriction to 5" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"has_public_id/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n ...
ruby
chosen
[ { "from": "system", "value": "Order company contacts by newer first\n" }, { "from": "human", "value": "class Admin::Companies::ContactsController < Admin::BaseController\n defaults class_name: 'CompanyContact'\n actions :index, :show\n\n def collection\n @contacts ||= apply_scopes(end_of_a...
ruby
chosen
[ { "from": "system", "value": "Fix for immigration placeholder manual 404ing\n" }, { "from": "human", "value": "namespace :router do\n task :router_environment => :environment do\n require 'plek'\n require 'gds_api/router'\n\n @router_api = GdsApi::Router.new(Plek.current.find('router-a...
ruby
chosen
[ { "from": "system", "value": "Allow accessing the request and response from SinatraSession\n" }, { "from": "human", "value": "require 'webrat/rack'\nrequire 'sinatra'\nrequire 'sinatra/test/methods'\n\nmodule Webrat\n class SinatraSession < RackSession #:nodoc:\n include Sinatra::Test::Metho...
ruby
chosen
[ { "from": "system", "value": "Set Go111MODULE to 'off' during compilation\n\nGiven more to the Go community moves to Go modules, one might default to\nGO111MODULE to on in their environment. If this is done, this project\nfails to compile.\n\nBy setting the environment for the compilation this is fixed.\n" ...
ruby
chosen
[ { "from": "system", "value": "Change the cache store to a memory store so that caching will be performed if it is turned on\n" }, { "from": "human", "value": "GradeCraft::Application.configure do\n config.action_controller.perform_caching = false\n config.action_dispatch.best_standards_support...
ruby
chosen
[ { "from": "human", "value": "Expand URL fields from 255 to 2048\n\n* discussions and pages" }, { "from": "gpt", "value": "class LongerUrlFields < ActiveRecord::Migration\n def up\n change_column :discussions, :url, :string, limit: 2048\n change_column :pages, :url, :string, limit: 2048\n ...
ruby
chosen
[ { "from": "system", "value": "Add API as \"POST /systems\" to create system entry.\n" }, { "from": "human", "value": "# Copyright 2014 TIS inc.\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 may o...
ruby
chosen
[ { "from": "system", "value": "Make debugger available in testing\n" }, { "from": "human", "value": "# Configure Rails Environment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire_relative \"../test/dummy/config/environment\"\nActiveRecord::Migrator.migrations_paths = [File.expand_path(\"../test/dummy/d...
ruby
chosen
[ { "from": "system", "value": "Save LogEntry records if they are being rolled back\n\nRelated to #1767\n" }, { "from": "human", "value": "module Spree\n class LogEntry < ActiveRecord::Base\n belongs_to :source, :polymorphic => true\n end\nend\n" }, { "from": "gpt", "value": "modu...
ruby
chosen
[ { "from": "system", "value": "Check uncommited code in a project.\n" }, { "from": "human", "value": "module ReactOnRails\n module GitUtils\n def self.uncommitted_changes?(message_handler)\n return false if ENV[\"COVERAGE\"]\n status = `git status`\n return false if status.incl...
ruby
chosen
[ { "from": "system", "value": "Fix report problem form for readonly user\n" }, { "from": "human", "value": "class ProblemReportsController < ApplicationController\n skip_before_action :ensure_user\n\n def create\n problem_report = ProblemReport.new(problem_report_params)\n ProblemReportMa...
ruby
chosen
[ { "from": "system", "value": "Fix of bug in `Spree::LocalizedNumber.parse`, which mangles object passed as an argument.\n" }, { "from": "human", "value": "module Spree\n class LocalizedNumber\n\n # Strips all non-price-like characters from the number, taking into account locale settings.\n ...
ruby
chosen
[ { "from": "human", "value": "Write a test for the functional_test_location" }, { "from": "gpt", "value": "require 'minitest/autorun'\nrequire_relative '../lib/tritium/config'\n\nclass ConfigTest < MiniTest::Unit::TestCase\n\n def test_functional_location\n assert File.exists?(Tritium.functio...
ruby
chosen
[ { "from": "system", "value": "Add spec dependencies to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'picturefill/version'\n\nGem::Specification.new do |gem|\n ge...
ruby
chosen
[ { "from": "system", "value": "Make Watir example run on Celerity again (broken by 9d00123).\n" }, { "from": "human", "value": "require 'spec'\n\ncase PLATFORM\nwhen /darwin/\n require 'safariwatir'\n Watir::Browser = Watir::Safari\nwhen /win32|mingw/\n require 'watir'\n Watir::Browser = Wati...
ruby
chosen
[ { "from": "system", "value": "Fix album import error message\n" }, { "from": "human", "value": "require \"album_set_processor\"\n\nnamespace :import do\n task :all_photos, [:path] => :environment do |t, args|\n AlbumSetProcessor.new(args.path).syncronize_photos\n end\n\n task :albums => :e...
ruby
chosen
[ { "from": "system", "value": "Fix mocha initialization deprecation warning\n\nMaintains compatability with all versions of mocha\n" }, { "from": "human", "value": "ENV[\"TEST\"] = 'true'\nrequire 'rubygems'\nrequire 'coveralls'\nCoveralls.wear!\nrequire 'minitest/autorun'\n$:.unshift File.expand...
ruby
chosen
[ { "from": "system", "value": "Make sure coveralls is initialized before anything else\n" }, { "from": "human", "value": "require 'ruby-bbcode'\nrequire \"minitest/autorun\"\nrequire 'coveralls'\n\nCoveralls.wear!\n\n# This hack allows us to make all the private methods of a class public.\nclass ...
ruby
chosen
[ { "from": "system", "value": "Clean mongo db before running tests\n" }, { "from": "human", "value": "# Configure Rails Envinronment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE__)\nrequire \"rails/test_help\"\n\nActionMailer::Base.deliver...
ruby
chosen
[ { "from": "system", "value": "Add spec for direction coercion in a materialized relation\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe Relation::Materialized, '.new' do\n let(:header) { Relation::Header.coerce([ [ :id, Integer ] ]) }\n let(:tuples) {...
ruby
chosen
[ { "from": "system", "value": "Use superclassing instead of alias method as it breaks loading (routes defined way later)" }, { "from": "human", "value": "module DoorkeeperSsoClient\n module Mixins\n module ControllerHelpers\n extend ActiveSupport::Concern\n\n module ClassMethods\n ...
ruby
chosen
[ { "from": "system", "value": "Fix cartesian product to sort terms to avoid dups like [a,b],[b,a]" }, { "from": "human", "value": "class Array\n def cartesian_product(b)\n raise \"bad args\" unless b.kind_of?(Array)\n\n return self if b.empty?\n return b if self.empty?\n\n prod = sel...
ruby
chosen
[ { "from": "system", "value": "Set to eager_loading when rails eager_load! called\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nCoverband.eager_loading_coverage!\nmodule Coverband\n class Railtie < Rails::Railtie\n initializer 'coverband.configure' do |app|\n app.mi...
ruby
chosen
[ { "from": "system", "value": "Remove class inheritance instance variable hack\n" }, { "from": "human", "value": "module NetSuite\n module Support\n module Fields\n include Attributes\n\n def self.included(base)\n base.send(:extend, ClassMethods)\n end\n\n module Cl...
ruby
chosen
[ { "from": "system", "value": "Fix pathname because of different interface in 1.9.x\n" }, { "from": "human", "value": "# Because we use plugins that are shipped via gems, we lose their rake tasks.\n# So here, we find them (if there are any) and include them into rake.\nextra_rake_tasks = []\nif d...
ruby
chosen
[ { "from": "system", "value": "Use another internal impl as drop_chunks does not accept BIGINT\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n$stdout.sync = true\n$stderr.sync = true\n\nnamespace :mnemosyne do\n desc 'Clean up old traces and spans'\n task clean: :environmen...
ruby
chosen
[ { "from": "system", "value": "Fix redis-namespace blind passthrough deprecation\n" }, { "from": "human", "value": "require \"active_support\"\nrequire File.expand_path(\"../../lib/forgetsy.rb\", __FILE__)\n\nRSpec.configure do |c|\n c.before(:each) do\n redis = Forgetsy.redis\n redis.flus...
ruby
chosen
[ { "from": "system", "value": "Raise the connect_timeout and increase the default tested version to 1.1\n" }, { "from": "human", "value": "require 'yaml'\nrequire 'rspec'\n\nCASSANDRA_VERSION = ENV['CASSANDRA_VERSION'] || '1.0' unless defined?(CASSANDRA_VERSION)\n\n$LOAD_PATH << \"#{File.expand_p...
ruby
chosen
[ { "from": "system", "value": "Update gemspec with latest gem versions\n" }, { "from": "human", "value": "# encoding: UTF-8\n$:.push File.expand_path('../lib', __FILE__)\nrequire 'solidus_page_objects/version'\n\nGem::Specification.new do |s|\n s.name = 'solidus_page_objects'\n s.version...
ruby
chosen
[ { "from": "system", "value": "Add todo for removing a file\n" }, { "from": "human", "value": "module Everything\n module AddPiecesToPieceRefinement\n refine Everything::Piece do\n attr_reader :parent\n\n def parent=(parent_piece)\n @parent = parent_piece\n end\n\n ...
ruby
chosen