conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Configure to run jobs in resque\n" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\nrequire 'rails/all'\n\n# Require the gems listed in Gemfile, including any gems\n# you've limited to :test, :development, or :production.\nBundler.req...
ruby
chosen
[ { "from": "system", "value": "Add default of use_ssl for datastax agent.\n" }, { "from": "human", "value": "# Datastax agent config options\ndefault['datastax-agent']['enabled'] = false\ndefault['datastax-agent']['version'] = '4.1.1-1'\ndefault['datastax-agent']['conf_dir'] = '/var/lib/datastax-...
ruby
chosen
[ { "from": "system", "value": "Add liquid as a dependency\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'condensation/version'\n\nGem::Specification.new do |gem|\n gem.nam...
ruby
chosen
[ { "from": "human", "value": "Add CocoaPods podspec; it seems standard for pod projects\n" }, { "from": "gpt", "value": "Pod::Spec.new do |s|\n s.name = 'OCHamcrest'\n s.version = '3.0.0'\n s.license = 'BSD'\n s.summary = 'Hamcrest for Objective-C: Powerful, combinable, extensible matc...
ruby
chosen
[ { "from": "system", "value": "Hide delta output in acceptance tests.\n" }, { "from": "human", "value": "class SphinxController\n def initialize\n config.searchd.mysql41 = 9307\n end\n\n def setup\n FileUtils.mkdir_p config.indices_location\n config.render_to_file && index\n\n Thin...
ruby
chosen
[ { "from": "system", "value": "Use single quoted strings when you don't need int-\nerpolation\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe ProjectsController do\n let(:user) { FactoryGirl.create(:user) }\n\n describe \"creating a project without permissions\" do\n bef...
ruby
chosen
[ { "from": "system", "value": "Add back pending in before(:all) to test for @myronmarston\n" }, { "from": "human", "value": "# -*- encoding : utf-8 -*-\nrequire 'spec_helper'\n\ndescribe StalenessNotificationJob do\n # NOTE: commented out because now RSpec exists with 1 on pending specs\n # whi...
ruby
chosen
[ { "from": "system", "value": "Fix compatiblity with MiniTest 4\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule MongoModel\n specs_for(Document, EmbeddedDocument) do\n shared_examples_for \"ActiveModel\" do\n require 'minitest'\n require 'minitest/assertions'\n ...
ruby
chosen
[ { "from": "system", "value": "Add first? and last? methods to base block\n" }, { "from": "human", "value": "class BaseBlock < Forest::ApplicationRecord\n self.abstract_class = true\n\n has_one :block_slot, class_name: 'BlockSlot', as: :block, dependent: :destroy\n\n def self.display_name\n ...
ruby
chosen
[ { "from": "system", "value": "Use the ActiveSupport Date helper method today?\n" }, { "from": "human", "value": "class Calendar\n class Division\n attr_reader :slug, :title\n alias :to_param :slug\n\n def initialize(slug, data = {})\n @slug = slug\n @title = data.delete(\"tit...
ruby
chosen
[ { "from": "system", "value": "Move comment to the module level\n\nIt's a general comment about the modelo, not about the specific method\nunderneath.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n#\n# Spam related functionality\n#\nmodule Spamable\n def self.included(base)...
ruby
chosen
[ { "from": "system", "value": "Convert ProjectFinancial to ruby class w/o ActiveRecord\n" }, { "from": "human", "value": "class ProjectFinancial < ActiveRecord::Base\n acts_as_copy_target\n\n def readonly?\n true\n end\nend\n" }, { "from": "gpt", "value": "class ProjectFinancial...
ruby
chosen
[ { "from": "system", "value": "Add a time to duplicable tests\n\n\ngit-svn-id: afc9fed30c1a09d8801d1e4fbe6e01c29c67d11f@7907 5ecf4fe2-1ee6-0310-87b1-e25e094e27de\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../abstract_unit'\n\nclass DuplicableTest < Test::Unit::TestCase\...
ruby
chosen
[ { "from": "system", "value": "Send id in the current view\n\ncc @robertdolca\n" }, { "from": "human", "value": "attributes :year,\n :name,\n :camp_start_date,\n :camp_end_date,\n :motto,\n :current\n" }, { "from": "gpt", "value": "att...
ruby
chosen
[ { "from": "system", "value": "Remove null bytes when parsing text\n" }, { "from": "human", "value": "class ContentParser\n def self.parse_mc_tags(content)\n return content unless content.present?\n\n content.gsub!('[mc]', '<pre lang=\"python\"><code>')\n content.gsub!('[/mc]', '</code>...
ruby
chosen
[ { "from": "system", "value": "Add sign_in_as_admin! method to ApiHelpers file\n" }, { "from": "human", "value": "module ApiHelpers\n def json_response\n JSON.parse(response.body)\n end\n\n def assert_unauthorized!\n json_response.should == { \"error\" => \"You are not authorized to perf...
ruby
chosen
[ { "from": "system", "value": "Update documentation for Cryptocompare::Stats.rate_limit method\n" }, { "from": "human", "value": "require 'faraday'\nrequire 'json'\n\nmodule Cryptocompare\n module Stats\n API_URL = 'https://min-api.cryptocompare.com/stats/rate/limit'.freeze\n private_const...
ruby
chosen
[ { "from": "system", "value": "Update Redis documentation (up to 3.2.1)\n" }, { "from": "human", "value": "module Docs\n class Redis < UrlScraper\n self.type = 'redis'\n self.release = 'up to 3.2.0'\n self.base_url = 'http://redis.io/commands'\n self.links = {\n home: 'http://re...
ruby
chosen
[ { "from": "system", "value": "Add documentation comment for the method\n" }, { "from": "human", "value": "require 'fileutils'\n\nclass Licences\n\n\tdef self.generateCleanAcknowledgementsPlist(target, path)\n\t\tputs \"Generating acknowledgements with dependencies from \" + target.name\n\n\t\tso...
ruby
chosen
[ { "from": "system", "value": "Revert \"Show honeypot field to see if that stops spammers\"\n\nThis reverts commit 4135f6c6258862249a0b78d60729aa943ce305d8.\n" }, { "from": "human", "value": "InvisibleCaptcha.setup do |config|\n # config.honeypots << ['more', 'fake', 'attribute', 'name...
ruby
chosen
[ { "from": "system", "value": "Use acts_as touch option in acts_as_discussion_topic\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule Extensions::DiscussionTopic::ActiveRecord::Base\n module ClassMethods\n # Declare this in model, for it to support discussions.\n #\n...
ruby
chosen
[ { "from": "system", "value": "Create the devise_views directory in './app/views' instead of the root.\n\nSigned-off-by: José Valim <0c2436ea76ed86e37cc05f66dea18d48ef390882@gmail.com>\n" }, { "from": "human", "value": "class DeviseViewsGenerator < Rails::Generators::Base\n desc \"Copies all Dev...
ruby
chosen
[ { "from": "system", "value": "Add def for Character class\n" }, { "from": "human", "value": "module Poke\n\n class Character\n end\n \nend\n" }, { "from": "gpt", "value": "module Poke\n # +Character+ is a base class for both non-player and player characters. It\n # contains vari...
ruby
chosen
[ { "from": "system", "value": "Declare fields with automatically declares the '_id' field\n" }, { "from": "human", "value": "require \"my_mongoid/document/class_methods\"\nrequire \"my_mongoid/attributes\"\nrequire \"my_mongoid/field\"\nrequire \"my_mongoid/duplicate_field_error\"\n\nmodule MyMo...
ruby
chosen
[ { "from": "system", "value": "Fix the domain counter cache support\n" }, { "from": "human", "value": "class Record < ActiveRecord::Base\n extend InheritenceBaseNaming\n\n belongs_to :domain\n has_one :user, through: :domain\n\n validates :domain, presence: true\n\n default_scope order: [:na...
ruby
chosen
[ { "from": "system", "value": "Make sure to precompile serviceworker scripts\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\n# Version of your assets, change this if you want to expire all your assets.\nRails.application.config.assets.version = '1...
ruby
chosen
[ { "from": "system", "value": "Create a backend instance creator for applicationhelper\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n\tprotect_from_forgery\nend\n\n" }, { "from": "gpt", "value": "class ApplicationController < ActionController...
ruby
chosen
[ { "from": "system", "value": "Fix username not being saved\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to use :null_session instead.\n protect_from_forgery with: :exception...
ruby
chosen
[ { "from": "system", "value": "Add multiple icecast_status support to status controller\n" }, { "from": "human", "value": "require 'cache_lock'\n\nclass Json::StatusController < ApplicationController\n layout false\n\n def index\n items = {}\n\n icecast_status = Rails.cache.read('icecast_...
ruby
chosen
[ { "from": "system", "value": "Fix sort on plant parts\n" }, { "from": "human", "value": "class PlantPartsController < ApplicationController\n load_and_authorize_resource\n respond_to :html, :json\n responders :flash\n\n def index\n @plant_parts = PlantPart.all.order(\"plant_parts.name\")\...
ruby
chosen
[ { "from": "system", "value": "Enable deletion of expired dossiers en_construction\n\nfix #4977\n" }, { "from": "human", "value": "class ExpiredDossiersDeletionJob < CronJob\n self.schedule_expression = \"every day at 7 am\"\n\n def perform(*args)\n ExpiredDossiersDeletionService.process_exp...
ruby
chosen
[ { "from": "system", "value": "Create the bucket class to represent a rate limit bucket\n" }, { "from": "human", "value": "module Discordrb::Commands\n class RateLimiter\n end\nend\n" }, { "from": "gpt", "value": "module Discordrb::Commands\n class Bucket\n # Makes a new bucket\...
ruby
chosen
[ { "from": "system", "value": "Add .pre for next release\n" }, { "from": "human", "value": "# This file is maintained by a herd of rabid monkeys with Rakes.\nmodule EY\n class CloudClient\n VERSION = '1.0.1'\n end\nend\n# Please be aware that the monkeys like tho throw poo sometimes.\n" },...
ruby
chosen
[ { "from": "system", "value": "Remove obsolete flux types from Appender." }, { "from": "human", "value": "module KeplerProcessor\n class Appender < MultifileTaskBase\n\n attr_accessor :output_data\n include Saveable\n\n def execute!\n super do\n check_consistent_kic_number\n...
ruby
chosen
[ { "from": "system", "value": "Add option to opt out auto flushing during write.\n" }, { "from": "human", "value": "require \"elasticsearch\"\nrequire_relative \"../elasticsearch\"\n\nmodule Metacrunch\n module Elasticsearch\n class Writer\n\n def initialize(uri, log: false, bulk_size: 2...
ruby
chosen
[ { "from": "system", "value": "Add information about what the exception suppressor 'returns'\n" }, { "from": "human", "value": "module Resume\n # Module encapsulating all the functionality of the command line\n # interface to generate the resume.\n #\n # @author Paul Fioravanti\n module CLI\...
ruby
chosen
[ { "from": "human", "value": "Add data migration to move Natural England content to the RPA\n\nUnlike e4dcfa2, this is replacing the organisation, not just adding a\nnew one.\n" }, { "from": "gpt", "value": "natural_england = Organisation.find_by!(slug: 'natural-england')\nrpa = Organisation.find...
ruby
chosen
[ { "from": "system", "value": "Use tab character in HardTabs pre-commit hook\n\nTurns out some systems don't support `\\t` as an escape sequence. This\nwas resulting one spec failing for this hook.\n\nChanging it to a literal tab solves the problem.\n\nChange-Id: If4d50b64d2d341cb673cd1bb7c54f8841729b21d\nRe...
ruby
chosen
[ { "from": "system", "value": "Add organization_fields as a valid requirements resource type\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule ZendeskAppsSupport\n class AppRequirement\n TYPES = %w(automations channel_integrations macros targets views ticket_fields trig...
ruby
chosen
[ { "from": "system", "value": "Use a package available both locally and on Travis\n" }, { "from": "human", "value": "require 'feature_helper'\n\ndescribe \"Pip Dependencies\" do\n # As a Python developer\n # I want to be able to manage Pip dependencies\n\n let(:python_developer) { LicenseFinde...
ruby
chosen
[ { "from": "system", "value": "Add support for ios 6.0\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'DateTools'\n s.version = '1.0'\n s.summary = 'Dates and time made easy in Objective-C'\n s.homepage = 'https://github.com/MatthewYork/DateTools'\n\n...
ruby
chosen
[ { "from": "system", "value": "Update pod spec version up to 1.1.2\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"KMSWebRTC\"\n s.version = \"1.1.1\"\n s.summary = \"Kurento Media Server iOS Web RTC Call.\"\n s.homepage = \"https://g...
ruby
chosen
[ { "from": "system", "value": "Support regex in message type matchers\n" }, { "from": "human", "value": "module Messages\n class MessageTypeMatcher\n class << self\n attr_accessor :source, :dyno\n\n def source(source)\n @source = source\n end\n\n def dyno(dyno)\n ...
ruby
chosen
[ { "from": "system", "value": "Make default auth strategy return hash of user (just like ldap)\n" }, { "from": "human", "value": "require 'opscode/authentication/strategies/base'\n\nmodule Opscode\n module Authentication\n module Strategies\n class Local < Opscode::Authentication::Strate...
ruby
chosen
[ { "from": "system", "value": "Replace dash to entity reference\n\nPre-2.0 Rubies do not use UTF-8 source encoding by default\n" }, { "from": "human", "value": "module RailsAdmin\n module Config\n module Fields\n module Types\n class Boolean < RailsAdmin::Config::Fields::Base\n ...
ruby
chosen
[ { "from": "system", "value": "Add delete stack on CF\n" }, { "from": "human", "value": "module StackMaster\n module AwsDriver\n class CloudFormation\n def set_region(region)\n @region = region\n @cf = nil\n end\n\n def describe_stacks(options)\n cf.describ...
ruby
chosen
[ { "from": "human", "value": "Add script for adding Account records to Salesforce\n\nI used this code to add a record to Salesforce for each HCBU and HSI, so that we can run Salesforce reports on these categories of institution.\n" }, { "from": "gpt", "value": "########\n# HBCU #\n########\n\n# T...
ruby
chosen
[ { "from": "system", "value": "Fix game status primary key when running with sqlite\n" }, { "from": "human", "value": "#\n# Copyright (C) 2016 Powershop New Zealand Ltd\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentat...
ruby
chosen
[ { "from": "human", "value": "Add an Initial UpsellPage Model\n\nAdd an initial UpsellPage model with corresponding validations.\n" }, { "from": "gpt", "value": "class UpsellPage < ActiveRecord::Base\n attr_accessible :basic_articles_desc, :basic_courses_desc, :discussion_forums_desc, :exclusive...
ruby
chosen
[ { "from": "system", "value": "Fix missing whitespace in generated config.\n\nPrior to this commit, using the `DbOptimizationsGenerator` would result in\nan invalid `config/environments/development.rb`\n\nCommit b15c906 moved the injected code to a template, and we apparently lost\nsome necessary whitespace ...
ruby
chosen
[ { "from": "human", "value": "Complete in flight movie times solution\n" }, { "from": "gpt", "value": "# You've built an in-flight entertainment system with on-demand movie streaming.\n#\n# Users on longer flights like to start a second movie right when their first one ends, but they complain tha...
ruby
chosen
[ { "from": "system", "value": "Fix broken breadcrumb for company and resource calendar\n" }, { "from": "human", "value": "module BreadcrumbHelper\n def breadcrumb_part_for_previous_page\n path, title = path_and_title_from_referer\n\n content_tag(:li) do\n content_tag(:a, href: path) d...
ruby
chosen
[ { "from": "system", "value": "Fix bug using 'meetings' instead of 'meeting' on input name\n" }, { "from": "human", "value": "module ComponentsHelper\n def static_map(options={})\n react_component(\n 'StaticMap',\n latitude: options[:latitude],\n longitude: options[:longitude],...
ruby
chosen
[ { "from": "system", "value": "Remove the custom code for caching stores.\n\nThere's an issue I get with Marshal complaining about a singleton which can't be\ndumped. I currently don't have time to pursue this, so I'm letting it as is.\n" }, { "from": "human", "value": "module Concerns\n module ...
ruby
chosen
[ { "from": "system", "value": "PrototypeMail: Make the window variable an instance variable\n" }, { "from": "human", "value": "class AppDelegate\n def application(application, didFinishLaunchingWithOptions:launchOptions)\n window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)\n ...
ruby
chosen
[ { "from": "system", "value": "Fix - retire assertion erronée\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass SondagesControllerTest < ActionController::TestCase\n\n def setup\n @contributeur = create(:contributeur)\n end\n\n test \"nouveau sondage\" do\n sign_in @contr...
ruby
chosen
[ { "from": "system", "value": "Add spec that GC.stat values increase after GC is run\n" }, { "from": "human", "value": "require_relative '../../spec_helper'\n\ndescribe \"GC.stat\" do\n it \"supports access by key\" do\n keys = [:heap_free_slots, :total_allocated_objects, :count]\n keys.ea...
ruby
chosen
[ { "from": "system", "value": "Check connection before two new adaptor function bodies.\n" }, { "from": "human", "value": "require 'net/ftp'\nrequire 'fileutils'\n\nmodule ImageProcessing\n class FtpAdaptor\n include FileUtils\n \n def initialize(config)\n # set up the ftp connecti...
ruby
chosen
[ { "from": "system", "value": "Add password field to Logon message\n" }, { "from": "human", "value": "module Fix\n module Protocol\n module Messages\n\n #\n # A FIX logon message\n #\n class Logon < Message\n\n unordered :body do\n field :encrypt_method, ...
ruby
chosen
[ { "from": "system", "value": "Fix the JSON Backend to not symbolize names\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule FrozenRecord\n module Backends\n module Json\n extend self\n\n def filename(model_name)\n \"#{model_name.underscore.pluralize}...
ruby
chosen
[ { "from": "system", "value": "Add safer rails version comparison.\n\nThanks @lazyatom\n" }, { "from": "human", "value": "module PersistCampaign\n module Controller\n def self.included base\n base.send :include, InstanceMethods\n base.alias_method_chain :_compute_redirect_to_locatio...
ruby
chosen
[ { "from": "system", "value": "Use options hash for linked account\n" }, { "from": "human", "value": "class Podio::LinkedAccount < ActivePodio::Base\n property :linked_account_id, :integer\n property :label, :string\n property :provider, :string\n\n alias_method :id, :linked_account_id\n\n c...
ruby
chosen
[ { "from": "system", "value": "Fix RJS templates broken by render_with_remotipart alias\n\nRJS templates require a block to be passed to render, but the method\nsignature for render_with_remotipart does not support being passed a\nblock.\n" }, { "from": "human", "value": "module Remotipart\n # R...
ruby
chosen
[ { "from": "system", "value": "Add some comments for HtmlEntities module\n" }, { "from": "human", "value": "require 'htmlentities'\n\nclass StrSanitizer\n module HtmlEntities\n\n # Instantiate htmlentities class to use it for encoding and decoding html entities\n #\n # Params:\n # +n...
ruby
chosen
[ { "from": "system", "value": "Define the xml structure for a db report\n" }, { "from": "human", "value": "# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compl...
ruby
chosen
[ { "from": "human", "value": "Create general User Field Type\n" }, { "from": "gpt", "value": "class UserFieldType < FieldType\n VALIDATION_TYPES = {\n presence: :valid_presence_validation?\n }.freeze\n\n attr_accessor :id, :text, :field_name\n attr_reader :validations, :metadata\n\n valid...
ruby
chosen
[ { "from": "system", "value": "Replace execute call with vagrant read_state function\n\nThis is per a comment from jtopper. Using the provider's read_state\nfunction is much cleaner than calling out to VBoxManage, since we\nalready have access to the state data.\n" }, { "from": "human", "value": ...
ruby
chosen
[ { "from": "system", "value": "Add registrations to an access level\n\nNow you can ask an access level for all registrations for that access level.\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: access_levels\n#\n# id :integer not null, primary key...
ruby
chosen
[ { "from": "human", "value": "test(project/AddWorkDays): Add test for adding work days from project index\n\nRegression test: Following the 'add working hours' link on a project's index page lead to an 'undefined method' error.\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\ndescribe '...
ruby
chosen
[ { "from": "system", "value": "Correct result, previously showing wrong result\n" }, { "from": "human", "value": "require 'active_support/hash_with_indifferent_access'\n\nclass Hash\n\n # Returns an <tt>ActiveSupport::HashWithIndifferentAccess</tt> out of its receiver:\n #\n # { a: 1 }.with_...
ruby
chosen
[ { "from": "system", "value": "Put a condition to check if node already installed\n" }, { "from": "human", "value": "#\n# Cookbook Name:: nodejs\n# Recipe:: default\n#\n# Copyright 2015, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\n\n# bash resource to install nodejs\nbas...
ruby
chosen
[ { "from": "system", "value": "Expand path of user provided file in runner\n\nIf user provides a file without absolute or relative path and\nthe file exists in any of the directories of the $LOAD_PATH\nthe `Kernel.load` method will load the latter one instead of the\nintended one.\n\nExpanding the path of th...
ruby
chosen
[ { "from": "system", "value": "Set expiry on Covid landing pages actions individually\n\nThis is in preparation for logic being used to adjust the expiry time.\n" }, { "from": "human", "value": "require \"active_model\"\n\nclass CoronavirusLandingPageController < ApplicationController\n skip_bef...
ruby
chosen
[ { "from": "system", "value": "Fix call with second argument, using template source\n" }, { "from": "human", "value": "module ActionView\n class Template\n module Handlers\n class Tex\n def handles_encoding?; true; end\n\n class_attribute :default_format\n self.defau...
ruby
chosen
[ { "from": "system", "value": "Fix how progress bars show up in cron logs" }, { "from": "human", "value": "@metadata_directory = 'tmp/METADATA.jl'\n@github_directory = 'tmp/github'\n\ndef clean_field_list field_list\n cleaned_list = field_list.deep_dup\n cleaned_list.reject! { |field| field == ...
ruby
chosen
[ { "from": "system", "value": "Add Ryan Bates patch to use config from config folder\n\ngit-svn-id: 96bd6241e080dd4199045f7177cf3384e2eaed71@1448 2d86388d-c40f-0410-ad6a-a69da6a65d20\n" }, { "from": "human", "value": "require 'yaml'\r\n\r\nclass SeleniumOnRailsConfig\r\n @@defaults = {:environme...
ruby
chosen
[ { "from": "system", "value": "Revert \"chore: Automatic aliases for permitted_Attributes_for in policies\"\n\nThis reverts commit 8a61573383779a8fea86d02c7a3354bd00792b87.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Ditty\n class ApplicationPolicy\n attr_reader...
ruby
chosen
[ { "from": "system", "value": "Modify lookup for problem with multiple requests\n" }, { "from": "human", "value": "module GrapeTokenAuth\n class TokenAuthorizer\n attr_reader :data\n\n def initialize(authorizer_data)\n @data = authorizer_data\n end\n\n def authenticate_from_toke...
ruby
chosen
[ { "from": "human", "value": "Add plural rules missing from i18n\n" }, { "from": "gpt", "value": "{\n # Dari - this isn't an iso code. Probably should be 'prs' as per ISO 639-3.\n dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },\n # Latin America and C...
ruby
chosen
[ { "from": "system", "value": "Disable poem search on PoemPickerScreen: modify Appium test so\n" }, { "from": "human", "value": "# coding: utf-8\nrequire_relative 'spec_helper'\n\ndescribe '歌を検索するテスト' do\n\n it 'アプリのタイトルが正しく表示される' do\n current_screen_is TOP_TITLE\n end\n\n describe '検索窓に文字を...
ruby
chosen
[ { "from": "system", "value": "Define PK accessor if it's missing" }, { "from": "human", "value": "module ActiveAdmin::Mongoid::Document\n extend ActiveSupport::Concern\n\n included do\n self.primary_key ||= [:_id]\n end\n\n class Connection\n def initialize model\n @model = model\...
ruby
chosen
[ { "from": "system", "value": "Sort order as string as well as symbol\n" }, { "from": "human", "value": "module Daodalus\n module DSL\n module Aggregation\n class Sort\n include Aggregations\n\n def initialize(dao, aggregations, keys)\n @dao = dao\n ...
ruby
chosen
[ { "from": "system", "value": "Set the grandfathering of older accounts confirmation\n" }, { "from": "human", "value": "class AddConfirmableToDevise < ActiveRecord::Migration\n # Note: You can't use change, as User.update_all with fail in the down migration\n def up\n add_column :users, :con...
ruby
chosen
[ { "from": "system", "value": "Use Upstart if under ubuntu\n" }, { "from": "human", "value": "#\n# Cookbook Name:: omf\n# Recipe:: default\n#\n# Copyright 2014, YOUR_COMPANY_NAME\n#\n# All rights reserved - Do Not Redistribute\n#\n%w(ruby ruby-dev build-essential libssl-dev).each do |p|\n packag...
ruby
chosen
[ { "from": "system", "value": "Bump the worker docker image to v2.4.0\n" }, { "from": "human", "value": "default['travis_worker_wrapper']['install_type'] = 'docker'\n\noverride['travis_worker']['environment']['TRAVIS_WORKER_SELF_IMAGE'] = 'quay.io/travisci/worker:v2.3.1-61-g76a687b'\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Switch default SSL mode to 'allow'\n" }, { "from": "human", "value": "require 'uri'\nrequire 'cgi'\nrequire 'active_support/core_ext/hash/reverse_merge'\n\nmodule Redshift\n module Client\n class Configuration\n attr_reader :host, :port, :user, :password, :...
ruby
chosen
[ { "from": "system", "value": "Implement reading the amount of free memory available\n" }, { "from": "human", "value": "module SampleVagrantPlugin\n class Command < Vagrant.plugin(\"2\", \"command\")\n def execute\n machine = @env.machine(:default, :virtualbox)\n if machine.state.id...
ruby
chosen
[ { "from": "system", "value": "Fix for products having video thumbnail\n" }, { "from": "human", "value": "module ShopFinder\n module Shops\n class Wildberries\n def self.parse_attributes(page)\n raise 'Not implemented'\n end\n\n def self.parse_images(page)\n uri =...
ruby
chosen
[ { "from": "system", "value": "Move pose checking responsability away from Placement\n\nPlacement checked for pose when asked if on_board?. This is not\npart of its responsability.\n\nIn this commit, this responsability is delegated further down to\nthe board, object. That is Placement's expectation.\n" },...
ruby
chosen
[ { "from": "system", "value": "Add vector type to Post model\n" }, { "from": "human", "value": "class Post < ActiveRecord::Base\n\n has_and_belongs_to_many :tags\n validates_presence_of :title\n\n scope :internal_post, -> { where(type: \"InternalPost\") }\n scope :external_post, -> { where(ty...
ruby
chosen
[ { "from": "human", "value": "Fix rspec nil eager_load warning\n" }, { "from": "gpt", "value": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # The test environment is used exclusively to run your application's\n # test...
ruby
chosen
[ { "from": "system", "value": "Add a failing test to demonstrate UTF-8 characters being mangled\n" }, { "from": "human", "value": "require 'spec_helper'\n\n# Specs in this file have access to a helper object that includes\n# the DeliveriesHelper. For example:\n#\n# describe DeliveriesHelper do\n#...
ruby
chosen
[ { "from": "system", "value": "Fix off-by-one on a few signal values. Doh!\n" }, { "from": "human", "value": "require File.dirname(__FILE__) + '/../../spec_helper'\n\ndescribe \"Signal.list\" do\n it \"returns a hash of signal names mapped to the corresponding signal numbers\" do\n list = Sig...
ruby
chosen
[ { "from": "system", "value": "Add helper to stub signature\n\nIn test the signature can be stubbed using `stub_signature!`\n" }, { "from": "human", "value": "module ShipwireHacks\n def signature_hash(params)\n { 'X-Shipwire-Signature' => signature(params.to_json) }\n end\n\n private\n\n d...
ruby
chosen
[ { "from": "system", "value": "Add has_secure_password to User model for newer Rails-Bcrypt integration. Remove unneeded Bcrypt User model methods. Change User model validation to check :password_digest instead of :password_hash.\n" }, { "from": "human", "value": "class User < ActiveRecord::Base\...
ruby
chosen
[ { "from": "system", "value": "Add fake extension compilation. Try 1.\n" }, { "from": "human", "value": "\n=begin\n\n Fake extension building\n\n This allows for putting our bash scripts on the path, letting rubygems\n think we are compiling something...\n\n To fool rubygems we need a fake Ma...
ruby
chosen
[ { "from": "system", "value": "Add icon field to params on gift post route\n" }, { "from": "human", "value": "class GiftsController < ApplicationController\n def index\n @gifts = Gift.where(user_id: 1)\n\n render json: @gifts\n end\n\n def create\n @gift = Gift.new(\n user_id: para...
ruby
chosen
[ { "from": "system", "value": "Add latitude and longitude to permits\n" }, { "from": "human", "value": "class MoodsController < ApplicationController\n before_action :correct_user, only: :destroy\n\n def create\n @mood = current_user.moods.build(mood_params)\n if @mood.save\n flash[:...
ruby
chosen
[ { "from": "system", "value": "Change integration tests to catch ApiError instead of HttpResponseError\n" }, { "from": "human", "value": "require_relative '../test_helper'\n\nclass IntegrationTestHelper < Minitest::Test\n def setup\n @client = Smartsheet::Client.new(base_url: 'http://lo...
ruby
chosen
[ { "from": "system", "value": "Update SalesPage Model for video Attribute\n\nUpdate the SalesPage module to include the video attribute and\ncorresponding validations.\n" }, { "from": "human", "value": "class SalesPage < ActiveRecord::Base\n attr_accessible :call_to_action, :heading, :sub_headin...
ruby
chosen