conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Add in default value in case the environment variable isn't set\n" }, { "from": "human", "value": "# Delete old logs automatically when the server or console are started. For the\n# test environment, this is done in a before(:suite) hook.\nif Rails.env.development? ...
ruby
chosen
[ { "from": "system", "value": "Fix homepage. Bump to 0.0.3\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n s.name = \"petrovich\"\n s.version...
ruby
chosen
[ { "from": "system", "value": "Allow new version of strip in the gem\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nrequire File.expand_path('../lib/stripe_mock/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = \"stripe-ruby-mock\"\n gem.version ...
ruby
chosen
[ { "from": "system", "value": "Use the Figs environment variable for the secret token\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 cookie...
ruby
chosen
[ { "from": "system", "value": "Revert \"testing: rolling back superbolt dependency to 0.5.8 to test timeout cause\"\n\nThis reverts commit 815c8e4a7531c93de99354e49d8400d30b34f272.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(l...
ruby
chosen
[ { "from": "human", "value": "Add a placeholder for a spec\n" }, { "from": "gpt", "value": "require 'rspectacular'\nrequire 'referehencible'\n\nclass Referenced\n include Referehencible\nend\n\n# describe Referehencible do\n# it { expect(subject).to allow_value('a' * 32).for :guid }\n# ...
ruby
chosen
[ { "from": "system", "value": "Add using of the item_name helper to line item description\n" }, { "from": "human", "value": "Deface::Override.new(virtual_path: 'spree/orders/_line_item',\n name: 'option_values_at_line_item_description',\n insert_after: 'cod...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.9 to 0.1.10\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'telemetry-logger'\n s.version = '0.1.9'\n s.summary = 'Logging to STDERR with coloring and levels of severity...
ruby
chosen
[ { "from": "system", "value": "Fix moneta dependency so tests can pass more\n" }, { "from": "human", "value": "$:.unshift(File.dirname(__FILE__) + '/lib')\nrequire 'chef_zero/version'\n\nGem::Specification.new do |s|\n s.name = 'chef-zero'\n s.version = ChefZero::VERSION\n s.platform = Gem::Pl...
ruby
chosen
[ { "from": "system", "value": "Test on singleton local Core\n" }, { "from": "human", "value": "#require 'singleton'\n\nmodule Antir\n class Core < Antir::Resources::Core\n #attr_reader :address\n #include Singleton\n\n @@local = Antir::Resources::Core.first\n def @@local.load_config(...
ruby
chosen
[ { "from": "system", "value": "Add two new methods:\n1. bootstrap!, to add required methods to notifiable models\n2. react_to!, that accepts a model as an argument and reacts to any\n events on that model, if any\n" }, { "from": "human", "value": "require \"disclosure/engine\"\nrequire \"disclo...
ruby
chosen
[ { "from": "system", "value": "Update brew 0.2.1 package hashes" }, { "from": "human", "value": "require 'formula'\nclass Ripgrep < Formula\n version '0.2.1'\n desc \"Search tool like grep and The Silver Searcher.\"\n homepage \"https://github.com/BurntSushi/ripgrep\"\n\n if Hardware::CPU.is...
ruby
chosen
[ { "from": "system", "value": "Use `find_each` rather than `all.each`\n\nPerform the CreateDefaultStock migration in batches to lower memory footprint.\n\nFixes #4475\n" }, { "from": "human", "value": "class CreateDefaultStock < ActiveRecord::Migration\n def up\n Spree::StockLocation.skip_cal...
ruby
chosen
[ { "from": "system", "value": "Add properties to Page model : description, can_post and website\n" }, { "from": "human", "value": "module Mogli\n class Page < Profile\n set_search_type\n\n define_properties :id, :name, :category, :username, :access_token\n\n # General\n define_proper...
ruby
chosen
[ { "from": "system", "value": "Set test helper path for test-unit test suite\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\nrequire File.expand_path('../../config/environment', __FILE__)\n\nrequire 'test/unit/rails/test_help'\n\nrequire 'knapsack_pro'\n\n# CUSTOM_CONFIG_GOES_HERE...
ruby
chosen
[ { "from": "system", "value": "Add strong params for categories\n" }, { "from": "human", "value": "module Refinery\n module Products\n module Admin\n class CategoriesController < ::Refinery::AdminController\n\n crudify :'refinery/products/category',\n :xhr_paging =>...
ruby
chosen
[ { "from": "system", "value": "Implement actions for users controller\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n def new\n end\n\n def create\n end\n\n def edit\n end\n\n def update\n end\n\n def show\n end\n\n def index\n end\n\n def destroy\n...
ruby
chosen
[ { "from": "system", "value": "Fix a couple of style smells intorduced by last Pull Request\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.describe UpdateRepo::Metrics, '- Class to store & return run metrics' do\n subject { UpdateRepo::Metrics }\n\n context 'when created' do\...
ruby
chosen
[ { "from": "system", "value": "Remove nulls on bool column so default values work\n" }, { "from": "human", "value": "class CreateJunketCampaignTemplates < ActiveRecord::Migration\n def change\n create_table :junket_campaign_templates do |t|\n t.string :name\n t.string :campaign_name...
ruby
chosen
[ { "from": "system", "value": "Fix `url` stanza comment for SABnzbd.\n" }, { "from": "human", "value": "cask 'sabnzbd' do\n version '1.0.3'\n sha256 '0120f71189601a4b64e2309b671ddf892da8f50a4ad9716146d36baf83c6aae6'\n\n url \"https://github.com/sabnzbd/sabnzbd/releases/download/#{version}/SABn...
ruby
chosen
[ { "from": "system", "value": "Add coverage for admin zine index\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nfeature 'As a user' do\n\n before do\n sign_in\n\n create(:zine_with_authors,\n title: 'Zine 1',\n subtitle: 'Subtitle 1')\n end\n\n context...
ruby
chosen
[ { "from": "human", "value": "Add basic outline of user model tests.\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe User, type: :model do\n it \"has a valid name\"\n xit \"is invalid without a name\"\n xit \"has a valid email\"\n xit \"is invalid without an email\"\...
ruby
chosen
[ { "from": "system", "value": "Add more specific tests to Vote model spec\n\nTest the validity of new votes:\n * Records with valid keys\n * Records with duplicate keys of another record\n * Records without a 'user_id'\n * Records without an 'idea_id'\n" }, { "from": "human", "value": "re...
ruby
chosen
[ { "from": "system", "value": "Update opt-in flash message for CMU experiment\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"#{Rails.root}/lib/experiments/fall2017_cmu_experiment\"\n\nmodule Experiments\n class Fall2017CmuExperimentController < ApplicationControlle...
ruby
chosen
[ { "from": "system", "value": "Fix a bug that error is raised when multi-line format\n" }, { "from": "human", "value": "class ApiController < ApplicationController\n def tree\n render json: Treeview.tree(params[:path])\n end\n\n def file_preview\n file = params[:file]\n unless File.ex...
ruby
chosen
[ { "from": "human", "value": "Add join table for questions and tags\n" }, { "from": "gpt", "value": "class CreateTagsQuestionsJoinTable < ActiveRecord::Migration\n def change\n \tcreate_table :questions_tags, id: false do |t|\n t.belongs_to :question, index: true\n t.belongs_to :tag, ...
ruby
chosen
[ { "from": "system", "value": "Remove active student count, it's slow and we aren't actively using it\n" }, { "from": "human", "value": "class AssessmentsReport < Struct.new :log\n\n def print_report\n log.puts(report)\n end\n\n private\n\n def headers\n [\n 'Assessments:',\n ...
ruby
chosen
[ { "from": "system", "value": "Check user before using it.\n\n" }, { "from": "human", "value": "module Spree\n class DiscourseSsoController < Spree::StoreController\n def sso\n user = spree_current_user\n redirect_to login_path if user.nil?\n \n sso = SingleSignOn.parse(re...
ruby
chosen
[ { "from": "system", "value": "Fix notification message when admin label was modified\n" }, { "from": "human", "value": "class Admin::LabelsController < Admin::ApplicationController\n before_action :set_label, only: [:show, :edit, :update, :destroy]\n\n def index\n @labels = Label.templates....
ruby
chosen
[ { "from": "system", "value": "Add logger message to period contribution calculator\n\nWith this it becomes more easier to go through the logs and\nunderstand what each period is using as percentage to make\nthe calculations.\n" }, { "from": "human", "value": "module Wpcc\n class PeriodContribut...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement to = 0.50.0\n\nUpdates the requirements on [rubocop](https://github.com/bbatsov/rubocop) to permit the latest version.\n- [Release notes](https://github.com/bbatsov/rubocop/releases)\n- [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANGE...
ruby
chosen
[ { "from": "system", "value": "Include terminal-notifier files in gem.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.unshift File.expand_path('../lib', __FILE__)\nrequire 'kicker/version'\n\nGem::Specification.new do |s|\n s.name = \"kicker\"\n s.version = Kicker::VERSIO...
ruby
chosen
[ { "from": "system", "value": "Reduce batch size so that migration process isn't killed in production\n" }, { "from": "human", "value": "class AddParsedUserAgentToOpenEvents < ActiveRecord::Migration\n def change\n add_column :open_events, :ua_family, :string\n add_column :open_events, :ua...
ruby
chosen
[ { "from": "system", "value": "Add a development dependency on chef.\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"librarian/version\"\n\nGem::Specification.new do |s|\n s.name = \"librarian\"\n s.version = Lib...
ruby
chosen
[ { "from": "system", "value": "Install Bottle micro framework (for a simple app)\n" }, { "from": "human", "value": "#\n# Cookbook Name:: cookbook-ngxmgdbpy\n# Recipe:: python\n#\n# Author:: Juan Manuel Lopez\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not us...
ruby
chosen
[ { "from": "system", "value": "Improve commit message formatting in API responses\n" }, { "from": "human", "value": "class ShortCommitSerializer < ActiveModel::Serializer\n attributes :sha, :message\nend\n" }, { "from": "gpt", "value": "class ShortCommitSerializer < ActiveModel::Seri...
ruby
chosen
[ { "from": "system", "value": "Remove duplicate of \"Gem::Specification.new do |s|\"\n\nfix \"invalid gemspec\" error" }, { "from": "human", "value": "version = File.read(File.expand_path('../PROJECT_VERSION', __FILE__)).strip Gem::Specification.new do |s|\n\nGem::Specification.new do |s|\n s.na...
ruby
chosen
[ { "from": "system", "value": "Add result field to UserSearch jbuilder\n" }, { "from": "human", "value": "json.extract! @user_search, :id, :query, :hardware_uuid, :created_at, :updated_at\n" }, { "from": "gpt", "value": "json.extract! @user_search, :id, :query, :hardware_uuid, :result...
ruby
chosen
[ { "from": "system", "value": "Reorder config props for relevance\n" }, { "from": "human", "value": "require 'caprese/controller'\nrequire 'caprese/record'\nrequire 'caprese/routing/caprese_resources'\nrequire 'caprese/serializer'\nrequire 'caprese/version'\n\nmodule Caprese\n def self.config\n ...
ruby
chosen
[ { "from": "system", "value": "Add debug mode and messaging\n" }, { "from": "human", "value": "class SeedBed\n def plant( file )\n require \"db/seeds/#{file}.rb\"\n end\n \n def seed_msg( msg )\n puts \"\"\n puts \"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\"\n puts msg\n puts \"...
ruby
chosen
[ { "from": "system", "value": "Update required rubocop version to the latest stable release\n\n* an updated rubocop version is necessary because the goal is to add rspec-rubocop gem to the linter\ngem and for that a newer rubocop version is required\n" }, { "from": "human", "value": "# encoding: ...
ruby
chosen
[ { "from": "system", "value": "Update to newer aws-sdk to fix deps\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n\ts.name = 'rawstools'\n\ts.version = '0.1.1'\n\ts.date = '2016-10-11'\n\ts.summary = 'Ruby AWSTools'\n\ts.description = 'Tools for managing a cloud of AWS instance...
ruby
chosen
[ { "from": "system", "value": "Fix XML salary range generate\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nxml.instruct!\nxml.jobs do\n @offers.each do |offer|\n xml.job do\n xml.title { xml.cdata! offer.title }\n xml.id offer.id\n xml.description { xml.cd...
ruby
chosen
[ { "from": "system", "value": "Fix to storm cookbook with new runit.\n\n\nFormer-commit-id: 774c838f8be3998ed007f00200b1fe6f8c24987c [formerly a6dd7557a9c47d923f3f1478319ea9e8480ceb06] [formerly c871efc97c8339d06aea6faf59bbf45795d3920b [formerly 1b4f6347199649c4d440f8798fef1f58e5f1aa9f [formerly 7215d27a20fe...
ruby
chosen
[ { "from": "system", "value": "Use DISCOURSE_SSO_SECRET in syncing to forums" }, { "from": "human", "value": "class UserSyncWorker\n include Sidekiq::Worker\n\n def perform(user_id)\n user = User.find(user_id)\n client = DiscourseApi::Client.new(ENV['DISCOURSE_API_URL'])\n sso = user.t...
ruby
chosen
[ { "from": "system", "value": "C: Change required ruby version from 2.0.0 to 2.1.0\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'uidable/version'\n\nGem::Specification.new do |spec|...
ruby
chosen
[ { "from": "system", "value": "Remove Sidekiq::Testing in RepositoryController spec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Projects::Settings::RepositoryController do\n let(:project) { create(:project_empty_repo, :public) }\n let(:user) { create(:user) }\n\n befor...
ruby
chosen
[ { "from": "system", "value": "Remove obsolete windows image factories\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :windows_image do\n sequence(:name) { |n| \"windows_image_#{seq_padded_for_sorting(n)}\" }\n sequence(:description) { |n| \"windows_desc_#{seq_...
ruby
chosen
[ { "from": "system", "value": "Refactor to move upload logic away from test case\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'homepage upload', :type => :feature do\n before(:each) do\n @registered_user = Invite.create(:description => 'even')\n .users\n .cre...
ruby
chosen
[ { "from": "system", "value": "Fix specs according to now specification\n" }, { "from": "human", "value": "describe Ruboty::DMM::Ranking do\n let(:instance) { described_class.new(command).call }\n\n describe '#call' do\n context 'with 24 argument' do\n subject { instance }\n\n let(...
ruby
chosen
[ { "from": "human", "value": "Make Postgres features not in schema.rb available\n\n* We're only using this feature right now. If we use more, we'll need a\n better way of dealing with them. Switching to structure.sql can't and\n won't help.\n" }, { "from": "gpt", "value": "RSpec.configure do |c...
ruby
chosen
[ { "from": "system", "value": "Update jekyll requirement from ~> 3.3 to >= 3.3, < 5.0\n\nUpdates the requirements on [jekyll](https://github.com/jekyll/jekyll) to permit the latest version.\n- [Release notes](https://github.com/jekyll/jekyll/releases)\n- [Changelog](https://github.com/jekyll/jekyll/blob/mast...
ruby
chosen
[ { "from": "system", "value": "Fix bad path to extconf.rb in gemspec\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/mosquitto/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"mosquitto\"\n s.version = Mosquitto::VERSION\n s.summary = \...
ruby
chosen
[ { "from": "human", "value": "Write solution for vegetable counter\n" }, { "from": "gpt", "value": "def count_vegetables(s)\n arr = make_arr(s)\n hash = hash_counter(arr)\n nested_arr = hash.sort_by { |key, value| [value, key] }\n nested_arr.reverse.map! { |arr| arr.reverse }\nend\n\ndef hash...
ruby
chosen
[ { "from": "system", "value": "Change Fixnum to Integer for Ruby 2.4\n" }, { "from": "human", "value": "module GuessableLookup\n \n def lookup(*path)\n data = self\n path.each { |key| data = guess_key(data, key) }\n data\n rescue\n nil\n end\n \n private\n \n # Guesses which...
ruby
chosen
[ { "from": "system", "value": "Fix regex from listen :only\n\nThe readme from listen warns about this:\nNote: :only regexp patterns are evaluated only against relative file paths.\n\nThis was causing funky behaviour. Forcing unecessary updates if files\nthat share the same name were present under the same di...
ruby
chosen
[ { "from": "system", "value": "Add treetop to list of dependencies\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'kangaruby/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Cover a missing spec mutation\n\n* The code needs to be tested with a mix of unique and duplicate attributes\n otherwise some branches of the code are not tested.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe Relation::Header, '.new' do\n su...
ruby
chosen
[ { "from": "system", "value": "Fix the conditions: compatibility in associations" }, { "from": "human", "value": "module Crowdblog\n class User < ActiveRecord::Base\n has_many :authored_posts, inverse_of: :author,\n foreign_key: 'author_id', class_name: 'Post'\n has_many :published_...
ruby
chosen
[ { "from": "system", "value": "Order the documents on the admin page too.\n" }, { "from": "human", "value": "class DocumentTopic < ActiveRecord::Base\n belongs_to :document\n belongs_to :topic\nend" }, { "from": "gpt", "value": "class DocumentTopic < ActiveRecord::Base\n belongs_to...
ruby
chosen
[ { "from": "system", "value": "Include events json data in causes show route\n" }, { "from": "human", "value": "module Api\n module V1\n class CausesController < ApplicationController\n\n def index\n causes = Cause.all\n render json: causes\n end\n\n def show\n ...
ruby
chosen
[ { "from": "human", "value": "Add migrations file to create users table\n" }, { "from": "gpt", "value": "Sequel.migration do\n change do\n create_table(:users) do\n primary_key :uid\n String :nickname, :null => false\n String :email, :null => false\n String :auth_key, :nul...
ruby
chosen
[ { "from": "human", "value": "Add Cocoapods spec file (.podspec) for Cocoapods dependency manager support. Didn't push to trunk yet (still have TODOs: documentation url, screenshot url)\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = \"Clue\"\n s.version = \"0.1.0\...
ruby
chosen
[ { "from": "system", "value": "Return nil for a non-existing attribute.\n" }, { "from": "human", "value": "require 'specter/context'\n\nsubject Specter::Context\n\nspec '.new accepts nothing' do\n context = Specter::Context.new\n\n assert context.name, :nil?\nend\n\nspec '.new accepts a hash of...
ruby
chosen
[ { "from": "system", "value": "Fix shipping rates service level migration\n" }, { "from": "human", "value": "class AddServiceLevelToSpreeShippingRates < ActiveRecord::Migration\n def change\n add_column :spree_shipping_rates, :service_level_id, default: nil\n end\nend\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Include Resourceful in local shell.\n" }, { "from": "human", "value": "require 'session'\nrequire 'shellwords'\n\nmodule ElectricSheep\n module Shell\n class LocalShell\n include Directories\n\n def initialize(logger)\n @logger = logger\n e...
ruby
chosen
[ { "from": "system", "value": "Fix to check is just is already running before changing state to running.\n" }, { "from": "human", "value": "require 'setup_job'\n\nclass RunJob\n def self.run(jobs)\n jobs.each do |job|\n if job.aasm_events_for_current_state.include? :finish\n \n ...
ruby
chosen
[ { "from": "system", "value": "Fix missed variable for Compass integration\n" }, { "from": "human", "value": "base_directory = File.expand_path(File.join(File.dirname(__FILE__), '..'))\nbreakpoint_stylesheets_path = File.join(base_directory, 'stylesheets')\n\nif (defined? Compass)\n require 'sa...
ruby
chosen
[ { "from": "system", "value": "Make the validations constant more readable" }, { "from": "human", "value": "module Lotus\n module Validations\n class ValidationSet\n VALIDATIONS = [:presence, :acceptance, :format, :inclusion, :exclusion, :confirmation, :size].freeze\n\n def initiali...
ruby
chosen
[ { "from": "system", "value": "Prepare EU Exit Finder publisher takes an array of topics\n" }, { "from": "human", "value": "require 'publishing_api_finder_publisher'\n\nclass PrepareEuExitFinderPublisher\n TEMPLATE_CONTENT_ITEM_PATH = \"config/prepare-eu-exit.yml.erb\".freeze\n\n def initialize...
ruby
chosen
[ { "from": "system", "value": "Add missing command for action dispatch\n" }, { "from": "human", "value": "module RorVsWild\n module Plugin\n class ActionDispatch\n def self.setup\n return if @installed\n return unless defined?(::ActiveSupport::Notifications)\n Active...
ruby
chosen
[ { "from": "system", "value": "Hide socket related functionality in Dispatcher\n" }, { "from": "human", "value": "require 'sorted_array'\nrequire 'exchange'\nrequire 'message'\n\nclass Dispatcher\n def initialize(event_socket)\n @socket = event_socket.accept\n @exchange = Exchange.new\n ...
ruby
chosen
[ { "from": "system", "value": "Use number of seconds instead of 7.days for cache time to live" }, { "from": "human", "value": "module CachedResource\n # The Config class is a singleton that contains\n # global configuration options for CacheResource\n class Config\n include Singleton\n\n ...
ruby
chosen
[ { "from": "system", "value": "Remove rails version check, it is redundant with requirements\n" }, { "from": "human", "value": "module MagicGrid\n if ::Rails.version < \"3.1\"\n require 'magic_grid/railtie'\n else\n require 'magic_grid/engine'\n end\nend\n" }, { "from": "gpt", ...
ruby
chosen
[ { "from": "system", "value": "Remove unused argument from clipboard_button helper\n" }, { "from": "human", "value": "module ClipboardHelper\n def clipboard_button(target = nil)\n content_tag :button,\n icon('clipboard'),\n class: 'btn btn-xs btn-clipboard js-clipboard-trigger',\n ...
ruby
chosen
[ { "from": "system", "value": "Fix multiple results return from FollowSuggestion.get\n" }, { "from": "human", "value": "class FollowSuggestion\n def self.get(for_account_id)\n neo = Neography::Rest.new\n account_ids = neo.execute_query('START a=node:account_index(Account={id}) MATCH (a)-[:...
ruby
chosen
[ { "from": "system", "value": "FIX: Replace type with activity_type in the model\n" }, { "from": "human", "value": "class UnitActivitySet < ActiveRecord::Base\n belongs_to :unit\n\n validates :type, presence: true\n validates :unit_id, presence: true\nend\n" }, { "from": "gpt", "va...
ruby
chosen
[ { "from": "system", "value": "Add Maps API v2 related config to authenticated v4/me endpoint\n\n" }, { "from": "human", "value": "module Carto\n module Api\n module Public\n class UserPublicProfilePresenter < UserPublicPresenter\n\n def initialize(user)\n @user = user\n ...
ruby
chosen
[ { "from": "system", "value": "Make FieldInspector use only public Virtus API\n\nIt turns out that this is possible after all.\n" }, { "from": "human", "value": "class FieldInspector\n Field = Struct.new(:name, :cardinality, :type) do\n def array?\n cardinality == :many\n end\n\n d...
ruby
chosen
[ { "from": "system", "value": "Rename variable to filter and match intent in dhis2 auto complete.\n" }, { "from": "human", "value": "class AutocompleteController < PrivateController\n def organisation_unit_group\n autocomplete_for(:organisation_unit_groups)\n end\n\n private\n\n def autoco...
ruby
chosen
[ { "from": "system", "value": "Fix n+1 issue on index page\n" }, { "from": "human", "value": "require \"slim\"\n\nmodule Errdo\n class ErrorsController < Errdo::ApplicationController\n\n include Errdo::Helpers::ViewsHelper\n helper_method :user_show_string, :user_show_path\n\n before_ac...
ruby
chosen
[ { "from": "system", "value": "Fix to gettext_i18n_rails to match API\n" }, { "from": "human", "value": "require 'active_support/version'\nif Gem::Version.new(ActiveSupport::VERSION::STRING) > Gem::Version.new(\"2\")\n require 'active_support/all'\nelse\n require 'active_support'\nend\nrequire ...
ruby
chosen
[ { "from": "system", "value": "Fix case-sensitivity issue w/English library\n" }, { "from": "human", "value": "require 'english'\n\nmodule GitTracker\n module Repository\n\n def self.root\n path = `git rev-parse --show-toplevel`.chomp\n abort unless $CHILD_STATUS.exitstatus == 0\n ...
ruby
chosen
[ { "from": "system", "value": "Initialize formatter if not given by caller same way as level\n" }, { "from": "human", "value": "require 'httparty/logger/apache_logger'\nrequire 'httparty/logger/curl_logger'\n\nmodule HTTParty\n module Logger\n def self.build(logger, level, formatter)\n l...
ruby
chosen
[ { "from": "system", "value": "Replace all requires with require_all\n\nChanges only for main file with module in my lib\n" }, { "from": "human", "value": "module TZFormater\n FILENAME = File.expand_path('tzformater/data/formats.pstore', File.dirname(__FILE__))\nend\n\nrequire 'tzformater/pstore...
ruby
chosen
[ { "from": "system", "value": "Use File.expand_path for 1.8 compatibility.\n" }, { "from": "human", "value": "require File.expand_path(\"spec_helper\", File.dirname(__FILE__))\n\ndescribe \"Nesta::Path\" do\n before(:each) do\n @root = File.absolute_path(File.dirname(File.dirname(__FILE__)))\...
ruby
chosen
[ { "from": "system", "value": "Fix method signature of exceptions\n\nIn 6d85804 the method signature of `render_exception` was changed to\nrequire the `request` instead of the `env` and the `ExceptionWrapper`\nwas changed to take a `backtrace_cleaner` instead of the `env`.\n\nThis required changes to this me...
ruby
chosen
[ { "from": "system", "value": "Validate a string using regex and remove unwanted funcs\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire_relative '2'\nrequire 'strscan'\n\nInputString = \"1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736\"\n\n# def freq s\n# x...
ruby
chosen
[ { "from": "system", "value": "Fix MySQL migration, obtain lock the right way\n\nAs suggested by @yorrickpeterse in\nhttps://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4581#note_12373882\nthe locking of the MySQL database wasn't correct.\n" }, { "from": "human", "value": "# rubocop:disable al...
ruby
chosen
[ { "from": "system", "value": "Move timeout to write as read is causing a hang\n" }, { "from": "human", "value": "raise 'Patch already integrated into buildr code' unless Buildr::VERSION.to_s == '1.5.5'\n\nclass URI::HTTP #:nodoc:\n private\n def connect\n if proxy = proxy_uri\n proxy =...
ruby
chosen
[ { "from": "system", "value": "Remove Game::display hash configuration in favor of flat configuration\n" }, { "from": "human", "value": "class Yeah::Game\n attr_reader :display, :keyboard, :mouse, :space\n\n class << self\n attr_accessor :title, :space\n\n private\n\n def inherited(kla...
ruby
chosen
[ { "from": "system", "value": "Add dependency on bourbon \"> 4\", \"< 6\"\n\nbourbon 3.0 seems to error using this syntax\n\n @include padding(1em null)\n\nI've tested against bourbon 5.0.0.alpha.0, which works fine so we\nshouldn't exclude that release.\n" }, { "from": "human", "value": "# enc...
ruby
chosen
[ { "from": "system", "value": "[DOC] Add homepage URL to gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"matrioska/version\"\n\nGem::Specification.new do |s|\n s.name = \"matrioska\"\n s.version = Matrios...
ruby
chosen
[ { "from": "system", "value": "Resolve unmet hd preferences N+1 issues\n" }, { "from": "human", "value": "require_dependency \"renalware/hd\"\n\nmodule Renalware\n module HD\n class PatientsWithUnmetPreferencesQuery\n\n def initialize(query = {})\n @query = query\n end\n\n ...
ruby
chosen
[ { "from": "system", "value": "Add missing space before closing hash brace\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire \"erb\"\nrequire \"uri\"\nrequire \"action_dispatch/http/request\"\nrequire \"active_support/actionable_error\"\n\nmodule ActionDispatch\n class ...
ruby
chosen
[ { "from": "system", "value": "Fix a bug in the Server\n" }, { "from": "human", "value": "module BusyBunny\n # Server is a special case of Handler which not only takes requests from a\n # queue but puts back its responses on a different queue.\n class Server < Handler\n RESPONSE_QUEUE = ''\...
ruby
chosen
[ { "from": "system", "value": "Add CICLOMS TACROMS SIROMS CMVD TROP to MDM pathology\n\nRequested by Barts\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire_dependency \"renalware/pathology\"\n\nmodule Renalware\n module Pathology\n # Responsible for defining the set...
ruby
chosen
[ { "from": "system", "value": "Add post_install message to gemspec regarding +insert_after+\n" }, { "from": "human", "value": "# coding: utf-8\n\nGem::Specification.new do |spec|\n spec.name = 'grape-middleware-logger'\n spec.version = '1.7.0'\n spec.platform = Gem::Platfor...
ruby
chosen
[ { "from": "human", "value": "Add acceptance test for new\n" }, { "from": "gpt", "value": "require 'minitest/autorun'\nrequire 'selenium-webdriver'\n\n#\n# Test the new page\n#\nclass TestNew < MiniTest::Test\n def setup\n @driver = Selenium::WebDriver.for :chrome\n end\n\n def teardown\n ...
ruby
chosen
[ { "from": "system", "value": "Test for handling existing route '/health' in app\n" }, { "from": "human", "value": "require 'test_helper'\nrequire 'rack/test'\n\nclass Wet::HealthEndpointTest < Minitest::Test\n include Rack::Test::Methods\n\n def app\n Rails.application\n end\n\n def test_...
ruby
chosen