conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Check all data in Array. Change message\n" }, { "from": "human", "value": "require 'json'\nrequire 'jsonpath'\nmodule Embulk\n module Guess\n\n class Jsonpath < TextGuessPlugin\n Plugin.register_guess(\"jsonpath\", self)\n\n def guess_text(config, samp...
ruby
chosen
[ { "from": "system", "value": "Use current UNIX user, incase your name isn't Clint\n" }, { "from": "human", "value": "module GrowlTransfer\n class GTScp\n def initialize(output)\n @output = output\n end\n \n def download(remote, local_path)\n @output.puts \"Downloading #{re...
ruby
chosen
[ { "from": "system", "value": "Add missing rarity for each card\n" }, { "from": "human", "value": "module Hatokura\n module FairyGarden\n def self.const_missing(identifier)\n Hatokura.const_missing(identifier)\n end\n\n class FarmVillage < Card\n Name = '農村'\n Cost = 1\n ...
ruby
chosen
[ { "from": "system", "value": "Use puts instead of system echo\n" }, { "from": "human", "value": "module MrT\n class GitBranchSelect < Selector/'b'\n def items\n `git branch -a`.split.reject { |s| s == \"*\" || s == \"->\" || s.strip.empty? }\n end\n\n action :merge, \"Merge into c...
ruby
chosen
[ { "from": "system", "value": "Use logger instead of puts\n" }, { "from": "human", "value": "require 'resque'\nrequire \"resque/heroku/version\"\n\n# https://github.com/resque/resque/issues/1559#issuecomment-310908574\nResque::Worker.class_eval do\n def unregister_signal_handlers\n trap('TERM...
ruby
chosen
[ { "from": "system", "value": "Change tempfile name to ripl-editor.\n" }, { "from": "human", "value": "require 'tempfile'\n\nmodule Ripl::Commands::History\n def history(*args)\n Ripl::Commands::History.history(*args)\n end\n\n def editor(*args)\n Ripl::Commands::History.edit(*args)\n e...
ruby
chosen
[ { "from": "system", "value": "Fix test to match `Ember.VERSION`\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass PrecompileTest < TestCase\n def setup\n delete_assets!\n end\n\n def teardown\n ENV['RAILS_ENV'] = 'test'\n delete_assets!\n end\n\n def delete_assets!\...
ruby
chosen
[ { "from": "system", "value": "Connect Stomp client when running rake tasks\n" }, { "from": "human", "value": "require 'messenger'\n\nunless File.basename($0) == 'rake' || Rails.env.test?\n host = Rails.env.production? ? 'support.cluster' : 'localhost'\n uri = URI::Generic.build scheme: 'stomp'...
ruby
chosen
[ { "from": "system", "value": "Make sure Rabl is using Oj\n" }, { "from": "human", "value": "Rabl.configure do |config|\n config.cache_all_output = false\n config.cache_sources = Rails.env.production?\n config.include_json_root = false\n config.view_paths = [Rails.root.join('app/v...
ruby
chosen
[ { "from": "human", "value": "Add day 16: Aunt Sue\n" }, { "from": "gpt", "value": "DESIRES = {\n children: [3, :==.to_proc],\n cats: [7, :>.to_proc],\n samoyeds: [2, :==.to_proc],\n pomeranians: [3, :<.to_proc],\n akitas: [0, :==.to_proc],\n vizslas: [0, :==.to_proc],\n goldfish: [5, :<.t...
ruby
chosen
[ { "from": "system", "value": "Update CoursesWikis data migration task to use Assignments\n\nThis matches the way we previously imported revisions for courses; the wiki_ids feature was an edge case that didn't reflect the intention.\n" }, { "from": "human", "value": "# frozen_string_literal: true...
ruby
chosen
[ { "from": "system", "value": "Use a random users token for downloading pull requests\n\nAvoids the case of expired tokens\n" }, { "from": "human", "value": "desc \"Download new pull requests\"\ntask :download_pull_requests => :environment do\n User.all.each do |user|\n user.download_pull_req...
ruby
chosen
[ { "from": "system", "value": "Install php-fpm whenever we install php\n\nThis stops apt (un)helpfully installing and activating mod_php for us.\n" }, { "from": "human", "value": "#\n# Cookbook:: php\n# Recipe:: default\n#\n# Copyright:: 2020, OpenStreetMap Foundation\n#\n# Licensed under the Apa...
ruby
chosen
[ { "from": "system", "value": "Add webmock, typhoeus, and multi_json 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 'ruby_hue/version'\n\nGem::Specification.new ...
ruby
chosen
[ { "from": "system", "value": "Move mongoid to normal dependancy\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"railitics/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.new do |s|\n...
ruby
chosen
[ { "from": "system", "value": "Remove installation of nfs-kernel-server for debian\n\nthe idmap recipe on debian does not require nfs-kernel-server to be installed for functionality. see #43" }, { "from": "human", "value": "#\n# Cookbook Name:: nfs\n# Recipe:: _idmap\n#\n# Copyright 2014, Eric G....
ruby
chosen
[ { "from": "system", "value": "Fix the execute resource in streamingcollection\n\n\nFormer-commit-id: 754a691b7d70942367421fda3f49828c95143d8c [formerly 9b59ab7efbf5713065e233c29a79bf1cc44f02ff] [formerly d41ec10e314aaa2d9434ff7678b697c9cf4a4b4b [formerly 99e096defa786188fcc445f38b2cd9dfd30a211b [formerly 0e...
ruby
chosen
[ { "from": "system", "value": "Update array name to more accurately reflect updated purpose of storing any general value\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: rules\n#\n# id :integer not null, primary key\n# rule_type :string(255)\n...
ruby
chosen
[ { "from": "system", "value": "Increase commit log amount for tree view from 10 to 25\n\nSigned-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>\n" }, { "from": "human", "value": "class Projects::RefsController < Projects::ApplicationController\n include ExtractsP...
ruby
chosen
[ { "from": "system", "value": "Remove destructive and enumerative methods from the subscriptions controller, scope show to current_user\n" }, { "from": "human", "value": "class SubscriptionsController < ApplicationController\n before_action :set_subscription, only: [:show, :update, :destroy]\n\n...
ruby
chosen
[ { "from": "system", "value": "Fix Last Vote Item Being Nil When User Not Log In\n" }, { "from": "human", "value": "class UserSessionsController < ApplicationController\n def new\n \t@user = User.new \n end\n\n def create\n @user = current_user\n\n \tif @user = login(params[:email], param...
ruby
chosen
[ { "from": "system", "value": "Revert \"a small typo => 500 error\"\n\nThis reverts commit 60a80d41ff88850333f29026b7310c7219a0bc5f.\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n devise :omniauthable, :api_token_authenticatable\n\n has_many :tokens\n\n attr_accessible :n...
ruby
chosen
[ { "from": "system", "value": "Add validation for email and password\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\n # Include default devise modules. Others available are:\n # :confirmable, :lockable, :timeoutable and :omniauthable\n devise :database_authenticatable, :reg...
ruby
chosen
[ { "from": "system", "value": "Remove unnecessary variable from POST / action\n" }, { "from": "human", "value": "get '/' do\n @links = Link.desc('created_at').limit(10)\n\n erb :index\nend\n\npost '/' do\n link = Link.find_or_create_by(url: params[:url])\n\n redirect to('/')\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Apply 1 suggestion(s) to 1 file(s)" }, { "from": "human", "value": "#\n# Copyright 2012-2014 Chef Software, 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 ob...
ruby
chosen
[ { "from": "system", "value": "Fix forest error logic from testing\n" }, { "from": "human", "value": "module ForestErrorsHelper\n # Display errors that are only visible to admin users\n def forest_admin_error(error, options = {})\n if !Rails.env.production?\n logger.error(\"[Forest][Adm...
ruby
chosen
[ { "from": "system", "value": "Make order shipment validation a public method\n" }, { "from": "human", "value": "module Spree\n class Order::ShipmentValidationError < StandardError; end\n Order.class_eval do\n state_machines[:state].before_transition to: :complete, do: :ensure_valid_shipment...
ruby
chosen
[ { "from": "system", "value": "Add require for super class\n" }, { "from": "human", "value": "require \"date\"\n\nmodule HazCommitz\n class TimeBasedRepoRater < RepoRater\n\n def rate(github_repo)\n rating = MIN\n time_now = DateTime.now\n\n return MIN i...
ruby
chosen
[ { "from": "system", "value": "Revert 601dfd93f230 (which removed images from atom feed if a project had no image)\n\nWhile technically correct, we use some external services that rely on\nan image enclosure to be in place, so just for consistency, we'll\nalways include an image, even if it's the placeholder...
ruby
chosen
[ { "from": "system", "value": "Remove warning about deprecated .importjs\n\nThis deprecation has been there long enough to serve its purpose. I'm\ncleaning it out to stay lean.\n" }, { "from": "human", "value": "# Namespace declaration\nmodule ImportJS\n # We initialize an empty \"ImportJS\" nam...
ruby
chosen
[ { "from": "human", "value": "Fix an issue with old payment methods from the original paypal extension.\n\nSigned-off-by: Nathan Lowrie <nate@finelineautomation.com>\n\nFixes #58\n" }, { "from": "gpt", "value": "class RenamePaymentMethods < ActiveRecord::Migration\n def up\n execute <<-SQL\n ...
ruby
chosen
[ { "from": "system", "value": "Update sniff dependency to 1.x\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"automobile/version\"\n\nGem::Specification.new do |s|\n s.name = \"automobile\"\n s.version = BrighterPlanet::Aut...
ruby
chosen
[ { "from": "system", "value": "Fix elfinder error on rails5\n" }, { "from": "human", "value": "class Wor::ElfinderController < ApplicationController\n layout 'elfinder'\n\n def index\n end\n\n def elfinder\n h, r = ElFinder::Connector.new(\n :root => File.join(Rails.public_path, 'wor'...
ruby
chosen
[ { "from": "system", "value": "Expand the path so we're always in correct dir\n" }, { "from": "human", "value": "# Required so that we can set path correctly for Config, which is loaded statically due to a bug in cijoe\n$project_path = File.dirname(__FILE__) + '/app'\nrequire 'cijoe'\n\nclass CIJ...
ruby
chosen
[ { "from": "system", "value": "Fix version in chef-server-ctl manpage software definition\n" }, { "from": "human", "value": "# Copyright:: Copyright (c) 2014 Chef, Inc.\n# License:: Apache License, Version 2.0\n# Author:: Douglas Triggs <doug@getchef.com>\n#\n# Licensed under the Apache License, ...
ruby
chosen
[ { "from": "human", "value": "Add benchmark for allocating 40k objects with + without oink:\n\n user system total real\n40,000 empty iterations 0.000000 0.000000 0.000000 ( 0.002370)\nwithout instance type counter - instantiating 40,000 objects 0.910000 0.020000 ...
ruby
chosen
[ { "from": "human", "value": "Add benchmarks around `to_std(out|err)_from_any_process` matchers\n" }, { "from": "gpt", "value": "require 'rubygems'\nrequire 'bundler/setup'\nrequire 'benchmark'\nrequire 'rspec/expectations'\ninclude RSpec::Matchers\n\nn = 100_000\n\nBenchmark.bm(25) do |bm|\n bm...
ruby
chosen
[ { "from": "system", "value": "Update gc_ruboconfig requirement from ~> 2.33.0 to ~> 3.0.1\n\nUpdates the requirements on [gc_ruboconfig](https://github.com/gocardless/ruboconfig) to permit the latest version.\n- [Release notes](https://github.com/gocardless/ruboconfig/releases)\n- [Changelog](https://github...
ruby
chosen
[ { "from": "system", "value": "Use pure sql to migrate poll and vote types\n" }, { "from": "human", "value": "class SetPollAndVoteTypes < ActiveRecord::Migration\n\n def self.update_type_for_poll_votes(poll, type_name)\n poll.votes.each do |vote|\n vote.update_attribute('type', type_name...
ruby
chosen
[ { "from": "human", "value": "Add blank file for GPS\n" }, { "from": "gpt", "value": "# Your Names\n# 1)\n# 2)\n\n# We spent [#] hours on this challenge.\n\n# Bakery Serving Size portion calculator.\n\ndef serving_size_calc(item_to_make, order_quantity)\n library = {\"cookie\" => 1, \"cake\" => ...
ruby
chosen
[ { "from": "system", "value": "Add download functionality to download link in errors page\n" }, { "from": "human", "value": "module SandboxHelper\n def download_and_submit\n content_tag(:div, nil, class: 'download-and-submit') do\n content_tag(:div, nil, class: 'download-report') do\n ...
ruby
chosen
[ { "from": "system", "value": "Fix to be `to` instead of `bcc`\n" }, { "from": "human", "value": "class ContactMailer < ApplicationMailer\n\n def contact_email(message)\n @message = message\n @from = @message.email\n mail(from: message.email, reply_to: message.email, subject: message...
ruby
chosen
[ { "from": "system", "value": "Improve docs in SplitTimeData model\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# This Struct is a lightweight alternative to SplitTime when many objects are needed.\n# The time zone parsing methods in Rails are slow and create an unacceptabl...
ruby
chosen
[ { "from": "system", "value": "Add silent feed (for benchmark)\n" }, { "from": "human", "value": "app.feed(:hidden, desc: \"include hidden\") { $rec.hidden? }\napp.feed(:visible, desc: \"exclude hidden\") { !$rec.hidden? || app.opts[:show_hidden] }\n\napp.feed(:join, desc: \"join/connect messages...
ruby
chosen
[ { "from": "human", "value": "Add a test for tuple zipper\n" }, { "from": "gpt", "value": "# -*- encoding : utf-8 -*-\nrequire File.expand_path(File.dirname(__FILE__)) + '/helper'\n\nclass ZipTuplesTest < Test::Unit::TestCase\n include Tracksperanto::ZipTuples\n \n def test_zip_with_empty\n ...
ruby
chosen
[ { "from": "system", "value": "Fix spec name in podspec.\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"Opus-iOS\"\n s.version = \"1.0\"\n s.summary = \"iOS build scripts for the Opus Codec.\"\n s.homepage = \"https://chatsecure.org\"\n s.license ...
ruby
chosen
[ { "from": "system", "value": "Add a note which hook is meant for the git-hook\n" }, { "from": "human", "value": "#!/usr/bin/ruby\n\ngitconfig = File.expand_path(\"./gitconfig\")\n\n# Basic sanity check\nif File.exists?(gitconfig)\n # A better regex, if I could get it to work:\n # '\\\\[github\...
ruby
chosen
[ { "from": "system", "value": "Remove reference to unused controller.\n" }, { "from": "human", "value": "ActionController::Routing::Routes.draw do |map|\n map.resources :comments, :collection => {:ajax_create => :post}\n map.resources :mocks\n map.resources :mock_lists\n map.resources :projec...
ruby
chosen
[ { "from": "system", "value": "Use collection as a block\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n root 'patients#index'\n resources :medicines, only: [:index, :new, :create, :edit, :update]\n resources :patients, only: [:index, :new, :create, :edit, :update] do\n ...
ruby
chosen
[ { "from": "system", "value": "Fix routing for /auth/development which should have been POST\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n scope :module => 'federated_rails' do\n get '/login', :to => 'auth#login', :as => :login\n get '/logout', :to => 'auth#logout...
ruby
chosen
[ { "from": "system", "value": "Move destroy route to api timeslots controller\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n\n root \"dashboard#index\"\n get \"/auth/auth0/callback\" => \"auth0#callback\"\n get \"/auth/failure\" => \"auth0#failure\"\n get '/login', to...
ruby
chosen
[ { "from": "system", "value": "Set login as root page\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n resources :users, except: :index\n resources :videos\n resources :descriptions, except: :index\n\n get \"login\" => \"sessions#new\"\n post \"login\" => \"sessions#crea...
ruby
chosen
[ { "from": "system", "value": "Remove wildcard matcher on category path\n" }, { "from": "human", "value": "Rails.application.routes.draw do\n devise_for :users, class_name: 'Comfy::Cms::User'\n\n resources :word_documents\n\n scope '/admin' do\n get 'links/(*id)(.:format)' => 'links#show', ...
ruby
chosen
[ { "from": "system", "value": "Implement cleanup_spare! in the simple_tracker plugin\n" }, { "from": "human", "value": "module Jetpants\n class DB\n\n def is_spare?\n Jetpants.topology.spares.include? self\n end\n\n def claim!\n spares = Jetpants.topology.spares.reject do |sp|...
ruby
chosen
[ { "from": "system", "value": "Bring the spec into the 21st century\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"jekyll-sitemap\"\n s.summary = \"Automatically generate a sitemap.xml for your Jekyll site.\"\n s.version = \"0.4.1\"\n s.authors ...
ruby
chosen
[ { "from": "system", "value": "Fix a bug that contains an incorrect IP when an error occurs when searching seeds\n" }, { "from": "human", "value": "module Bitcoin\n module Network\n\n class PeerDiscovery\n\n attr_reader :logger\n\n def initialize\n @logger = Bitcoin::Logger.c...
ruby
chosen
[ { "from": "system", "value": "Set null to default router\n" }, { "from": "human", "value": "require 'slack-ruby-client'\n\nmodule Bodogem\n module SlackInterface\n class Client\n attr_accessor :router\n\n def initialize(channel_name)\n @client = Bodogem::SlackInterface::Clie...
ruby
chosen
[ { "from": "system", "value": "Call flush on STDOUT to make Jenkins print it correctly\n" }, { "from": "human", "value": "require 'thor/actions'\n\nrequire_relative '../util'\n\nclass Thor\n ##\n # Patch some Thor actions\n ##\n module Actions\n ##\n # Replace `run` with IO::popen to ac...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 0.78.0 to ~> 0.79.0\n\nUpdates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version.\n- [Release notes](https://github.com/rubocop-hq/rubocop/releases)\n- [Changelog](https://github.com/rubocop-hq/r...
ruby
chosen
[ { "from": "system", "value": "Use interpolation rather than sprintf\n" }, { "from": "human", "value": "require 'forwardable'\n\nrequire_relative 'ai/random'\nrequire_relative 'ai/min_max'\nrequire_relative 'player'\n\nclass ComputerPlayer\n extend Forwardable\n include Player\n\n def initiali...
ruby
chosen
[ { "from": "system", "value": "Tag for 0.4.1 and release\n\nSigned-off-by: Seapagan <4ab1b2fdb7784a8f9b55e81e3261617f44fd0585@gmail.com>\n" }, { "from": "human", "value": "# Define the Gem version string\nmodule Confoog\n # Version of this Gem, using Semantic Versioning 2.0.0\n # http://semver....
ruby
chosen
[ { "from": "system", "value": "Remove questions index route from questions controller\n" }, { "from": "human", "value": "get '/questions' do\n @survey = Survey.find_by(id: params[:survey_id])\n @questions = @survey.questions\n erb :'/questions/index'\nend\n\nget '/questions/new' do\n @survey ...
ruby
chosen
[ { "from": "system", "value": "Remove useless header from Space API response\n" }, { "from": "human", "value": "class SpaceApiController < ApplicationController\n before_action :set_access_control_headers, only: :status\n\n def status\n @space_api = SpaceApi.new\n end\n\n private\n de...
ruby
chosen
[ { "from": "system", "value": "[Pin] Set auto_capture to always be true so authorize is not attempted\n\nFixes #106\n" }, { "from": "human", "value": "module Spree\n class Gateway::PinGateway < Gateway\n preference :api_key, :string\n preference :currency, :string, :default => 'AUD'\n\n ...
ruby
chosen
[ { "from": "system", "value": "Load only if Rake is defined.\n" }, { "from": "human", "value": "require \"string-cases\"\nload \"#{File.dirname(__FILE__)}/tasks/plugin_migrator_tasks.rake\"\n\nmodule PluginMigrator\n def self.const_missing(name)\n require_relative \"plugin_migrator/#{::String...
ruby
chosen
[ { "from": "system", "value": "Revert \"delegate ruby template picking on reshares so the posts look better\"\n\nThis reverts commit 5eb22471916b0b2230c80096a28ad80f489b067e.\n" }, { "from": "human", "value": "class TemplatePicker\n attr_accessor :post\n\n TEMPLATES = %w{ status_with_photo_back...
ruby
chosen
[ { "from": "system", "value": "Fix syntax error and logout code\n" }, { "from": "human", "value": "require 'devise/strategies/base'\n\nmodule Devise\n module Strategies\n class DacsAuthenticatable < Base\n # True if the mapping supports authenticate_with_dacs.\n def valid?\n ...
ruby
chosen
[ { "from": "system", "value": "Use sidekiq service for restart\n" }, { "from": "human", "value": "include_recipe 'deploy'\ninclude_recipe 'sidekiq::service'\n\nnode['sidekiq'].each do |application, _|\n deploy = node['deploy'][application]\n deploy_to = deploy['deploy_to']\n\n node.default['de...
ruby
chosen
[ { "from": "human", "value": "Update ProjectTotal view to search only for contributions with requested_refund and confirmed states\n" }, { "from": "gpt", "value": "class ChangeProjectTotalContributionTypes < ActiveRecord::Migration\n def change\n execute <<-SQL\n CREATE OR REPLACE VIEW p...
ruby
chosen
[ { "from": "system", "value": "Refactor parser to understand different tags with unique or multiple definitions\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nmodule Oxford\n module Learners\n module Dictionaries\n class English\n attr_reader :definit...
ruby
chosen
[ { "from": "system", "value": "Add rake to the gemspec file\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire File.expand_path('../lib/contao/version', __FILE__)\n\nGem::Specification.new do |gem|\n gem.authors = [\"Wael Nasreddine\"]\n gem.email = [\"wael.nasr...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.8.1.0 to 0.9.0.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-messaging'\n s.version = '0.8.1.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description ...
ruby
chosen
[ { "from": "system", "value": "Update to new plugin method\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'twine'\n\nrequire_relative 'formatter'\nrequire_relative 'version'\n\nTwine::Formatters.formatters += [Twine::Formatters::Csharp]" }, { "from": "gpt", "value": "r...
ruby
chosen
[ { "from": "system", "value": "Include logic to not allow multiple votes by one user on the same comment\n" }, { "from": "human", "value": "class VotesController < ApplicationController\n\n def create\n @vote = Vote.new(value: 1, comment_id: params[:comment_id], user_id: current_user.id)\n ...
ruby
chosen
[ { "from": "system", "value": "Move method definition below callbacks\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# The RichText record holds the content produced by the Trix editor in a serialized `body` attribute.\n# It also holds all the references to the embedded files...
ruby
chosen
[ { "from": "system", "value": "Fix Related Content Score presence validations and unique composed key\n" }, { "from": "human", "value": "class RelatedContentScore < ActiveRecord::Base\n belongs_to :related_content, touch: true, counter_cache: :related_content_scores_count\n\n validates :user_id...
ruby
chosen
[ { "from": "system", "value": "Remove headers b/c its already implemented.\n" }, { "from": "human", "value": "module Typhoeus\n module Responses # :nodoc:\n\n # This module contains logic for providing the\n # old accessors.\n module Legacy\n\n # The legacy mapping.\n MAPPING ...
ruby
chosen
[ { "from": "system", "value": "Update simple form picker in dummy\n" }, { "from": "human", "value": "class DatePickerInput < SimpleForm::Inputs::Base\n \n def input(wrapper_options)\n \n if input_type == :date || input_type == :datetime || input_type == :time\n type = input_type\n e...
ruby
chosen
[ { "from": "system", "value": "Update test to match a previous change\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass UsersControllerTest < ActionController::TestCase\n setup do\n @user = users(:one)\n end\n\n test \"should get index\" do\n get :index\n assert_respon...
ruby
chosen
[ { "from": "system", "value": "Change powershell to single line command\n" }, { "from": "human", "value": "powershell_script 'Install IIS' do\n code <<- EOH\n Add-WindowsFeature Web-Server, \n Web-WebServer, \n Web-Common-Http, \n Web-Default-Doc,\n Web-Dir-Browsing,\n Web-Http-Errors,\n ...
ruby
chosen
[ { "from": "system", "value": "Fix Slack regular notifications TooManyRequestsError\n" }, { "from": "human", "value": "class SlackRegularWorker\n include Sidekiq::Worker\n\n def perform(issue_id, state)\n issue = Issue.find_by(id: issue_id) || return\n project = issue.project\n\n retur...
ruby
chosen
[ { "from": "system", "value": "Fix course announcement pagination spec\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe 'Course: Announcements', type: :feature do\n describe 'Pagination' do\n subject { page }\n\n let!(:instance) { create(:instance) }\n\n with_...
ruby
chosen
[ { "from": "human", "value": "Create test for aggregation base class\n\nSigned-off-by: Lucas Moura <143f96f992bf3dc84afaa2cc3d6d759a2b3ef261@gmail.com>\nSigned-off-by: Johnnys Ribeiro <e28a8c0275ee127bd6f2bdac708244856a0a7106@gmail.com>\n" }, { "from": "gpt", "value": "require_relative '../../spe...
ruby
chosen
[ { "from": "system", "value": "Use a controlled name for testing unknown hostnames\n\nSome ISP intercept unknown domains under .com/.org/.net, so using\nsomerandomname.com can easily fail.\n\nThey don't seem to intercept unknown hostnames under normal domains\nthough, so I've change us to use rubyspecdoesnte...
ruby
chosen
[ { "from": "system", "value": "Feature: Allow local configuration to be passed to looked up errors\n\nThis uses `Configuration#to_h` to generate a set of initialization values that\nare passed into each error that is looked up via `HumanError#fetch`.\n\nThis allows each instance of `HumanError` to create err...
ruby
chosen
[ { "from": "system", "value": "Fix error `uninitialized constant Namespace`\n" }, { "from": "human", "value": "require 'spec_helper' \n\ndescribe ActiveAdmin::Resource::BelongsTo do\n\n\n let(:application){ ActiveAdmin::Application.new }\n let(:namespace){ Namespace.new(application, :admin) }\n...
ruby
chosen
[ { "from": "system", "value": "Add scopes to the Post model to test handling of AR relations as input\n" }, { "from": "human", "value": "class Post < ActiveRecord::Base\n belongs_to :poster, :class_name => \"User\"\n\n has_many :votes, :as => :votable\n\n has_and_belongs_to_many :tags\n\n def...
ruby
chosen
[ { "from": "system", "value": "Add unless specs to match rubyspec\n" }, { "from": "human", "value": "describe \"The unless expression\" do\n it \"evaluates the unless body when the expression is false\" do\n unless false\n a = true\n else\n a = false\n end\n\n a.should == t...
ruby
chosen
[ { "from": "system", "value": "Remove is_active setter with '?'\n" }, { "from": "human", "value": "class IrsGroup\n include Mongoid::Document\n include Mongoid::Timestamps\n\n embedded_in :application_group\n\n # Unique identifier for this Household used for reporting enrollment and premium t...
ruby
chosen
[ { "from": "system", "value": "Use the correct keyword arg\n" }, { "from": "human", "value": "class Post::View < ApplicationRecord\n belongs_to :post, optional: false\n belongs_to :user, optional: false\n\n validates :post, uniqueness: { scope: :user }\n\n after_create :mark_favorite_read\n\n...
ruby
chosen
[ { "from": "system", "value": "Enable backtrace links for vendor/ files" }, { "from": "human", "value": "class BacktraceLine\n include Mongoid::Document\n IN_APP_PATH = %r{^\\[PROJECT_ROOT\\](?!(\\/vendor))/?}\n GEMS_PATH = %r{\\[GEM_ROOT\\]\\/gems\\/([^\\/]+)}\n\n field :number, :type => I...
ruby
chosen
[ { "from": "system", "value": "Replace errant removal of belongs_to\n" }, { "from": "human", "value": "class BzQueryEntry < ActiveRecord::Base\n attr_accessible :bz_id, :status,\n :pm_ack, :devel_ack, :qa_ack, :doc_ack,\n :version, :version_ack \n\nend\n" }, { "from": "gpt", "v...
ruby
chosen
[ { "from": "system", "value": "Add new methods for filter posts depend the date\n" }, { "from": "human", "value": "class DigestHistory < ActiveRecord::Base\n\n def self.create_new!(frequency)\n history = new(frequency: frequency)\n history.users_count = User.count\n history.save!\n h...
ruby
chosen
[ { "from": "human", "value": "Add data migration to resolve 0% measure\n\nIt was reported that the Erga Omnes value for cigarettes other was\nshowing as 0%. Upon investigation we discovered an incorrect measure had\nbeen supplied in the CHIEF file on 28/11/2018, to resolve this we've\nimplemented a data migr...
ruby
chosen
[ { "from": "system", "value": "Update gemspec to reflect we're testing with rspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"beacon\"\n s.version = \"0.1\"\n s.date = \"2009-04-22\"\n\n s.description = \"Simple and straightforward observers for your co...
ruby
chosen
[ { "from": "system", "value": "Update front-end test to fix jenkins\n" }, { "from": "human", "value": "require File.join(File.expand_path(File.dirname(__FILE__)), '../spec_helper.rb')\n\n#describe 'home page', :type => :request do\ndescribe 'dashboard' do \n it 'allows people to see the connect ...
ruby
chosen
[ { "from": "system", "value": "Use new metadata extend mechanism.\n" }, { "from": "human", "value": "require 'rubygems'\ngem 'caruby-core'\n\nrequire 'caruby/domain'\nrequire 'catissue/annotation/annotatable_class'\n\n# CaTissue wraps the caTissue Java API.\nmodule CaTissue\n # @param [<String>]...
ruby
chosen
[ { "from": "system", "value": "Align code headers definition and rename block variable" }, { "from": "human", "value": "module Jeckle\n module Resource\n def self.included(base)\n base.extend ClassMethods\n\n base.include Virtus.model\n\n base.include ActiveModel::Naming\n ...
ruby
chosen
[ { "from": "system", "value": "[SCR-710] Make private method authorised_feature? public\n" }, { "from": "human", "value": "# PerformFeature\nmodule PerformFeature\n def self.included(base)\n # base.send :class_inheritable_accessor, :feature_options\n case base.name\n when \"ActionCont...
ruby
chosen
[ { "from": "system", "value": "Change method name for a more Ruby one\n" }, { "from": "human", "value": "module RandomLocation\n extend self\n\n METERS_IN_DEGREE = 111_300\n\n def nearby(lat, lng, r)\n u = rand\n v = rand\n\n # Convert radius from meters to degrees\n radius = r.to_...
ruby
chosen