conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add specific tests for the ModelProxy class.\n\nWe were relying on this being tested during configuration until now, but when\nthe configuration changes we risk losing test coverage.\n" }, { "from": "gpt", "value": "#--------------------------------------------------...
ruby
chosen
[ { "from": "system", "value": "Fix `warning: character class has duplicated range`\n\nThis fixes the following warnings:\n\n```\nrailties/test/generators/encrypted_secrets_generator_test.rb:15: warning: character class has duplicated range: /[\\w\\d]+/\nrailties/test/generators/encrypted_secrets_generator_te...
ruby
chosen
[ { "from": "system", "value": "Add spec for league requests API\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'spec_helper'\n\ndescribe Api::LeagueRequestsController do\n render_views\n\n before do\n @user = create :user\n @user.groups << Group.league_admin_g...
ruby
chosen
[ { "from": "system", "value": "Update urls and names for Malaysia documents\n" }, { "from": "human", "value": "module CountriesHelper\n def is_malaysia?\n @country && @country.iso_3 == \"MYS\"\n end\n\n def is_japan?\n @country && @country.iso_3 == \"JPN\"\n end\n\n def malaysia_docume...
ruby
chosen
[ { "from": "system", "value": "Save goal last value to prevent double posting\n" }, { "from": "human", "value": "require 'trello' #it is not required by default for some reason\n\nclass BeeminderWorker\n include Sidekiq::Worker\n\n def perform\n Goal.joins(:provider).each do |goal|\n ca...
ruby
chosen
[ { "from": "system", "value": "Fix Action Mailbox ingress config example [ci skip]\n\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nsay \"Copying application_mailbox.rb to app/mailboxes\"\ncopy_file \"#{__dir__}/mailbox/templates/application_mailbox.rb\", \"app/mailboxes/appl...
ruby
chosen
[ { "from": "system", "value": "Add reference to Page Objects - suggested by Hugo Lopes Tavares\n" }, { "from": "human", "value": "# Full Watir API: http://wtr.rubyforge.org/rdoc/\n# Full RSpec API: http://rspec.rubyforge.org/\n\nGiven 'I am on the Google search page' do\n @browser.goto 'http://w...
ruby
chosen
[ { "from": "system", "value": "Remove private and reformat tiles\n" }, { "from": "human", "value": "class Scrabble\n attr_reader :word\n\n def initialize(word)\n @word = word.to_s.strip.downcase\n end\n\n def score\n word.chars.sum { |letter| TILE_POINTS[letter] }\n end\n\n private\n\...
ruby
chosen
[ { "from": "system", "value": "Add authentication for admin dashboard\n" }, { "from": "human", "value": "# All Administrate controllers inherit from this `Admin::ApplicationController`,\n# making it the ideal place to put authentication logic or other\n# before_filters.\n#\n# If you want to add p...
ruby
chosen
[ { "from": "system", "value": "Remove recipient-specific customization of body using Liquid\n\nSparkPost offers data substitution features that make it unnecessary\nto handle this login in-app.\n\nThe enduser syntax is eerily similar to Liquid's. The main advantage\nof using this method is that instead of se...
ruby
chosen
[ { "from": "system", "value": "Use Rails.root instead of RAILS_ROOT.\n" }, { "from": "human", "value": "require 'cross-stub'\n\nBefore do\n # /////////////////////////////////////////////////////////////////////////////////\n # NOTE: By default, we use file-based cache store for cross-stub. Alt...
ruby
chosen
[ { "from": "system", "value": "Refactor to remove unnecessary `send` calls\n" }, { "from": "human", "value": "require 'blockscore/util'\n\nmodule ResourceTest\n def resource\n @resource ||= BlockScore::Util.to_underscore(to_s[/^(\\w+)ResourceTest/, 1])\n end\n\n def test_create_resource\n ...
ruby
chosen
[ { "from": "system", "value": "Refactor Ruby 1.8 compatibility fix in provider selection\n\nThe change was introduced by 7f26b8846b36515a6648b3f94ab24036471d8370 which is using a Rails method to solve an incompatility issue between 1.8 and 1.9.\nIt's better no to couple Rails with the provider selection beca...
ruby
chosen
[ { "from": "human", "value": "Add some specs on the database schema itself\n\nAdd a spec to check that columns named like '_id' are always of type\nbigint and one to make sure there are no foreign keys.\n" }, { "from": "gpt", "value": "describe \"database\" do\n describe \"foreign keys\" do\n ...
ruby
chosen
[ { "from": "human", "value": "Add tests for shortcode quienmanda\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Shortcodes::QuienManda do\n it \"renders links with text\" do\n content = Shortcodes.shortcode('[quienmanda url=\"http://www.quienmanda.es\" text=\"quienmanda\"]...
ruby
chosen
[ { "from": "system", "value": "Disable API response caching in development.\n" }, { "from": "human", "value": "module Collections\n def self.services(name, service = nil)\n @services ||= {}\n\n if service\n @services[name] = service\n return true\n else\n if @services[nam...
ruby
chosen
[ { "from": "system", "value": "Make search_in_header available to the auth spec\n" }, { "from": "human", "value": "RSpec.describe 'shared/_authentication', :type => :view do\n let(:logged_in) { false }\n\n before do\n allow(controller).to receive(:default_url_options) do\n { locale: I18...
ruby
chosen
[ { "from": "system", "value": "Fix register to save the user to session, add a show route for user profile page\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n def new\n @user = User.new\n end\n\n def create\n @user = User.new(user_params)\n if (@use...
ruby
chosen
[ { "from": "system", "value": "Replace riseup email adress with team@speakerinnen.org\n" }, { "from": "human", "value": "class NotificationsMailer < ActionMailer::Base\n default from: 'speakerinnen@lists.riseup.net'\n default to: 'speakerinnen@lists.riseup.net'\n\n def new_message(message, to)...
ruby
chosen
[ { "from": "system", "value": "Replace double quotes with single \" -> '\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = \"SwiftSocket\"\n s.version = \"2.0\"\n s.summary = \"A cool framework to work with TCP and UDP sockets\"\n\n s.description = <<-DES...
ruby
chosen
[ { "from": "system", "value": "Tweak the number of items to display on pagination\n" }, { "from": "human", "value": "Kaminari.configure do |_config|\n # config.default_per_page = 25\n # config.max_per_page = nil\n # config.window = 4\n # config.outer_window = 0\n # config.left = 0\n # confi...
ruby
chosen
[ { "from": "system", "value": "Convert version test to a unit test instead of a spec\n" }, { "from": "human", "value": "require_relative '../../../test_helper'\n\ndescribe OmniAuth::OpenIDConnect::VERSION do\n it \"must be defined\" do\n OmniAuth::OpenIDConnect::VERSION.wont_be_nil\n end\nen...
ruby
chosen
[ { "from": "system", "value": "Test that a socket connection is refused.\n\nThe previous version used the 'timeout' gem to ensure this never connected. However, this test passed on Mac OS X 10.8.5 and immediately failed with an Errno::ECONNREFUSED on Ubuntu. After removing this timeout, I also get an ECONN...
ruby
chosen
[ { "from": "system", "value": "Set the default time of new patient events\n\nDefault the new event date to today and the time to the start of the current hour.\n" }, { "from": "human", "value": "require_dependency \"renalware/events\"\n\nmodule Renalware\n module Events\n class EventsControll...
ruby
chosen
[ { "from": "system", "value": "Fix rubocop warnings in CatalogHelper::TextualSummary\n" }, { "from": "human", "value": "module CatalogHelper::TextualSummary\n def tags_from_record\n tags = []\n @record.tags.each do |tag|\n values = tag.name.split('/')\n p = tags.find { |x| x[:lab...
ruby
chosen
[ { "from": "system", "value": "Include fontawesome on the list of assets to be precompiled by the asset pipeline\n\nFixes #4399\n" }, { "from": "human", "value": "module Spree\n module Backend\n class Engine < ::Rails::Engine\n config.middleware.use \"Spree::Backend::Middleware::SeoAssis...
ruby
chosen
[ { "from": "system", "value": "Change test_has_no_identity_if_it_has_not_been_persisted in TestCollection to correct intent\n" }, { "from": "human", "value": "module TestCollection\n # Anything that includes TestCollection must, during setup, assign @subject and @factory, where\n # @subject i...
ruby
chosen
[ { "from": "system", "value": "Refactor handling of env vars in config & remove EnvVars namespace\n" }, { "from": "human", "value": "module EnvVars\n class Application < Rails::Application\n config.before_configuration do\n env_file_name = Rails.root.join('config', 'env_vars.yml').to_s\n...
ruby
chosen
[ { "from": "human", "value": "Add feature specs for JSON-LD hashes\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe 'JSON-LD hashes', type: :feature, inaccessible: true do\n include_context 'custom products'\n\n shared_examples 'it contains JSON-LD hash' do\n it 'contains J...
ruby
chosen
[ { "from": "system", "value": "Set brexit landing page template to old style header\n\nWe will be setting the Explore Super Menu Header as the default across GOV.UK, so we need to switch the Brexit landing page to use a specific template from Static that has a header with the Sign in link. This is temporary,...
ruby
chosen
[ { "from": "system", "value": "Fix ArgumentError `Attempting to generate a URL from non-sanitized request parameters!`\n" }, { "from": "human", "value": "class Kuroko2::ApplicationController < ActionController::Base\n # Prevent CSRF attacks by raising an exception.\n # For APIs, you may want to...
ruby
chosen
[ { "from": "human", "value": "Create base controller using ActionController::Metal and few rails modules\n" }, { "from": "gpt", "value": "module Neighborly::Api\n class BaseController < ActionController::Metal\n include ActionController::Redirecting\n include AbstractController::Rendering\...
ruby
chosen
[ { "from": "system", "value": "Validate presence of category and data attribute\n" }, { "from": "human", "value": "class Event < ActiveRecord::Base\n belongs_to :user, polymorphic: true\n belongs_to :exercise\n belongs_to :file\nend\n" }, { "from": "gpt", "value": "class Event < Ac...
ruby
chosen
[ { "from": "system", "value": "Use 'deliver_later' to send emails\n" }, { "from": "human", "value": "class Order < ActiveRecord::Base\n has_many :order_items\n\n after_create :send_notifications\n\n validates :nombres,\n :email,\n :telefono,\n :direccion,\n ...
ruby
chosen
[ { "from": "human", "value": "Add fix to split Showers Pass teams\n" }, { "from": "gpt", "value": "class SplitShowersPassTeams < ActiveRecord::Migration\n def change\n if RacingAssociation.current.short_name == \"OBRA\"\n Team.transaction do\n mtb_team = Team.where(id: 36326, name...
ruby
chosen
[ { "from": "system", "value": "Add specs for stage_id reference cleanup migration\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire Rails.root.join('db', 'migrate', '20170710083355_clean_stage_id_reference_migration.rb')\n\ndescribe CleanStageIdReferenceMigration, :migration, :sid...
ruby
chosen
[ { "from": "system", "value": "Store :database or :path keys only once as Symbols\n\nhttp://is.gd/d6x3y left us with the possibility\nthat both :database and 'database' or :path and\n'path' keys would have been present in the options\nhash. In that case it wouldn't be clear which one\nwould win.\n\nSee comme...
ruby
chosen
[ { "from": "system", "value": "Allow NULL values in the field comment on table jenkins_build_changesets\n" }, { "from": "human", "value": "class CreateJenkinsBuildChangesets < ActiveRecord::Migration\n\n def self.up\n create_table :jenkins_build_changesets do |t|\n t.column :jenkins_buil...
ruby
chosen
[ { "from": "system", "value": "Update dependency version for active_model_serializers\n\nUsing Alpha1 breaks when adding a `has_one` relation and the relation is not set, throwing an error of `TypeError - no implicit conversion of nil into Array`" }, { "from": "human", "value": "# -*- encoding: u...
ruby
chosen
[ { "from": "system", "value": "Fix \"unable to modify frozen object\" at splat expansion on Rubinius\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule Rubocop\n module Cop\n module FavorOtherKeywordOverNegation\n def check(node)\n condition, _body, _rest = *node\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add implementation of eighth rule of disambiguator prefix\n" }, { "from": "gpt", "value": "module Sastrawi\n module Morphology\n module Disambiguator\n class DisambiguatorPrefixRule8\n def disambiguate(word)\n contains = /^ter([bcdfghjklmnpqr...
ruby
chosen
[ { "from": "system", "value": "Fix 'Unnecessary enabling of Layout/AccessModifierIndentation'\n" }, { "from": "human", "value": "class BookingResponder\n class BookingRequestProcessor\n attr_reader :options\n\n def initialize(staff_response, options = {})\n self.staff_response = staff...
ruby
chosen
[ { "from": "system", "value": "Remove uncalled method from generator\n" }, { "from": "human", "value": "require 'rails/generators'\nrequire 'rails/generators/migration'\n\nmodule HasPublishing\n class PublishingGenerator < ::Rails::Generators::NamedBase\n include Rails::Generators::Migration\...
ruby
chosen
[ { "from": "system", "value": "Add the has_many to the identity class\n" }, { "from": "human", "value": "class InvitationalGenerator < Rails::Generators::Base\n source_root File.expand_path('../templates', __FILE__)\n\n argument :identity_class, type: :string, default: \"User\", banner: \"Class...
ruby
chosen
[ { "from": "system", "value": "Update secret token so Devise works again\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 cookies will become...
ruby
chosen
[ { "from": "system", "value": "Move secret token to an environment variable\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 cookies will bec...
ruby
chosen
[ { "from": "system", "value": "Use correct test statement for task \"remove_unless_symlinked\"\n\nFixes #54\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\ninclude Capistrano::DSL\n\nrequire 'dkdeploy/i18n'\n\nnamespace :current_folder do\n desc \"Delete current folder unless...
ruby
chosen
[ { "from": "system", "value": "Reduce status count limit to get more urls.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nclass Pawoo::Sitemap::UserIndexesController < ApplicationController\n SITEMAPINDEX_SIZE = 50_000\n ALLOW_FOLLOWERS_COUNT = 1_000\n ALLOW_STATUS_COU...
ruby
chosen
[ { "from": "system", "value": "Add add_edge method call in make_edges\n" }, { "from": "human", "value": "class Graph\n def new(graph_info)\n @edges = {}\n make_edges(graph_info)\n end\n\n def make_edges(graph_info)\n graph_info.foreach do |node|\n if @edges[node]\n\n else\n\...
ruby
chosen
[ { "from": "system", "value": "Complete breadth first search method\n" }, { "from": "human", "value": "class Graph\n attr_reader :edges\n\n def initialize(graph_info, directed)\n @edges = {}\n @directed = directed\n make_edges(graph_info)\n end\n\n def make_edges(graph_info)\n gra...
ruby
chosen
[ { "from": "human", "value": "Add grape endpoint for the root path\n" }, { "from": "gpt", "value": "module DeboxServer\n module API\n module V1\n\n class Site < Grape::API\n\n version 'v1'\n format :json\n\n get '/' do\n 'debox'\n end\n\n end\n ...
ruby
chosen
[ { "from": "system", "value": "Remove active_model dependency from controller\n\nActive model was added in https://github.com/alphagov/collections/commit/da96d36d0116c5cca474b55757e876bb940cbf86 to support the live stream section.\nThe live stream was removed in May 2021 (see https://github.com/alphagov/coll...
ruby
chosen
[ { "from": "system", "value": "Add permitted params for pay easy\n" }, { "from": "human", "value": "Spree::CheckoutController.class_eval do\n def permitted_source_attributes\n super.push(permitted_komoju_konbini_attributes)\n super.push(permitted_komoju_banktransfer_attributes)\n super....
ruby
chosen
[ { "from": "system", "value": "Add class comment to callback controller\n" }, { "from": "human", "value": "class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController\n # You should configure your model like this:\n # devise :omniauthable, omniauth_providers: [:twitter]\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add spec for passenger integration\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe \"Passenger integration\" do\n before do\n Honeybadger::Dependency.reset!\n end\n\n context \"when passenger is not installed\" do\n it \"fails quietly\" do...
ruby
chosen
[ { "from": "system", "value": "Set typ field in JSONWebToken::RSAToken\n\nruby-jwt v2.0 removed the `typ` header in\nhttps://github.com/jwt/ruby-jwt/commit/cc41d53e00f8cbf015271b53f5ad761bd6ac2312.\n\nTo ensure tokens don't get marked invalid during an upgrade,\nadd it back to ensure backwards compatibility....
ruby
chosen
[ { "from": "system", "value": "Use shorter form of raising an error\n" }, { "from": "human", "value": "module ROM\n class Session\n\n class IdentityMap\n LoadedObject = Struct.new(:object, :tuple)\n\n class ObjectMissingError < StandardError\n def initialize(identity)\n ...
ruby
chosen
[ { "from": "system", "value": "Extend modules before including other modules\n" }, { "from": "human", "value": "require 'delegate'\nrequire 'forwardable'\n\nmodule SubDiff\n class DiffCollection < SimpleDelegator\n include Enumerable\n extend Forwardable\n\n def_delegators :diffs, :each...
ruby
chosen
[ { "from": "human", "value": "Allow null in some votes columns" }, { "from": "gpt", "value": "class AllowNullInVotesColumns < ActiveRecord::Migration\n def self.up\n change_column :votes, :ip_address, :string, :default => \"\", :null => true\n change_column :votes, :agent, :string, :defaul...
ruby
chosen
[ { "from": "system", "value": "Select organization on base controller as well\n" }, { "from": "human", "value": "module Api\n class BaseController < ActionController::Base\n Mumukit::Login.configure_controller! self\n\n protect_from_forgery with: :null_session\n\n include OnBaseOrganiza...
ruby
chosen
[ { "from": "system", "value": "Make language select redirect safer\n" }, { "from": "human", "value": "class LanguageController < ApplicationController\n def english\n I18n.locale = :en\n set_session_and_redirect\n end\n\n def finnish\n I18n.locale = :fin\n set_session_and_redirect\...
ruby
chosen
[ { "from": "system", "value": "Use the new Package.recent scope + whitespace cleanup\n" }, { "from": "human", "value": "class PackagesController < ApplicationController\n @@package_table = Package.table_name\n\n def index\n page_no = params[:page] || 1\n @search_term = String(params[:sear...
ruby
chosen
[ { "from": "system", "value": "Fix E1639: do not send any reminder on receiving self review.\n" }, { "from": "human", "value": "# E1600\n# A new type called SelfReviewResponseMap was created for ResponseMap to handle self-reviews independent\nclass SelfReviewResponseMap < ResponseMap\n belongs_t...
ruby
chosen
[ { "from": "system", "value": "Check if a template requires a password or not\n" }, { "from": "human", "value": "module Fog\n module Vcloud\n class Compute\n class CatalogItem < Fog::Vcloud::Model\n\n identity :href, :aliases => :Href\n attribute :links, :aliases => :Link, ...
ruby
chosen
[ { "from": "system", "value": "Fix chain of typo / autocorrect problems\n" }, { "from": "human", "value": "require 'stash/wrapper'\nrequire 'datacite/mapping'\n\nmodule Stash\n module Wrapper\n class StashWrapper\n attr_reader :datacite_resource\n\n def id_value\n identifier ...
ruby
chosen
[ { "from": "system", "value": "Fix a typo in the route name.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass SummaControllerRouteTest < ActionController::TestCase\n def setup\n @controller = SummaController.new\n end\n\n test \"root routes to summa controller show action\"...
ruby
chosen
[ { "from": "system", "value": "Use ! instead of not\n" }, { "from": "human", "value": "module Jekyll\n module Admin\n class Server < Sinatra::Base\n namespace \"/static_files\" do\n get do\n json static_files.map(&:to_liquid)\n end\n\n get \"/*\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Apply begin/rescue statement to github helper class methods\n" }, { "from": "human", "value": "require 'octokit'\n\nclass GithubHelper\n\n def self.create_issue(title)\n client = Octokit::Client.new(:access_token => Rails.application.secrets.github_token)\n i...
ruby
chosen
[ { "from": "system", "value": "Use SupportsFeatureMixin for querrying VM for resize operation\n\n\n(transferred from ManageIQ/manageiq@4e7604885c7890b21ad3a6a7e7a2e9437219be37)\n" }, { "from": "human", "value": "module MiqAeMethodService\n class MiqAeServiceManageIQ_Providers_Openstack_CloudMana...
ruby
chosen
[ { "from": "system", "value": "Make use of percent calculator\n" }, { "from": "human", "value": "require_dependency 'spree/calculator'\n\nmodule Spree\n class Calculator::FlatPercentItemTotal < Calculator\n preference :flat_percent, :decimal, default: 0\n\n def self.description\n Spre...
ruby
chosen
[ { "from": "system", "value": "Stop requiring the library in gemspec" }, { "from": "human", "value": "require File.expand_path('../lib/acts_as_versioned', __FILE__)\n\nGem::Specification.new do |gem|\n gem.name = 'mongo_mapper_acts_as_versioned'\n gem.version = MongoMapper::Acts::Ver...
ruby
chosen
[ { "from": "human", "value": "Create migrate to remove unneeded contractor fields from db\n" }, { "from": "gpt", "value": "class RemoveContractorFromPermits < ActiveRecord::Migration\n def change\n remove_column :permits, :contractor, :boolean\n remove_column :permits, :contractor_name, :s...
ruby
chosen
[ { "from": "human", "value": "Create migration for changing contractors.acn type\n" }, { "from": "gpt", "value": "class ChangeAcnTypeInContractors < ActiveRecord::Migration\n def self.up\n change_column :contractors, :acn, :string\n end\n\n def self.down\n change_column :contractors, :ac...
ruby
chosen
[ { "from": "system", "value": "Use the proper Ruby classes in properties\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "# frozen_string_literal: true\n#\n# Cookbook:: rabbitmq\n# Resource:: erlang_zypper_repository_on_suse_factory...
ruby
chosen
[ { "from": "system", "value": "Use hostnamectl to set the hostname on Ubuntu Vivid 15.\n" }, { "from": "human", "value": "module VagrantPlugins\n module GuestUbuntu\n module Cap\n class ChangeHostName < VagrantPlugins::GuestDebian::Cap::ChangeHostName\n def self.change_host_name(m...
ruby
chosen
[ { "from": "system", "value": "Make cleanup of /tmp/os-image-rspec* work\n\nPreviously, the cleanup was failing silently due to a permission\nproblem. This make stemcell building machines stop working after\na short amount of time (with disk full errors)\n" }, { "from": "human", "value": "require...
ruby
chosen
[ { "from": "system", "value": "Fix a bug in PackageToken.\n" }, { "from": "human", "value": "module Furnace::AVM2::Tokens\n class PackageToken < Furnace::Code::NonterminalToken\n def initialize(origin, options={})\n options[:ns] = options[:ns].reject { |ns|\n ns.name == \"\" || ns...
ruby
chosen
[ { "from": "system", "value": "Add specs for new called on each Attribute subclass\n" }, { "from": "human", "value": "require File.expand_path('../../../../../spec_helper', __FILE__)\n\ndescribe 'Veritas::Attribute.new' do\n describe 'when called on the Attribute class' do\n subject { Attribu...
ruby
chosen
[ { "from": "human", "value": "Add Adobe Digital Editions 2.0.1\n\nOld DRM scheme version of Digital Editions.\r\nFixes and corrections are added." }, { "from": "gpt", "value": "cask :v1 => 'adobe-digital-editions2' do\n version '2.0.1'\n sha256 'dcaec3e2cbb2faa7720a2ff06d13af4fe0433cdf991c76eee...
ruby
chosen
[ { "from": "system", "value": "Support ruby 1.8.7 and 1.9.2 (and development versions)\n" }, { "from": "human", "value": "ruby_release = \"#{RUBY_VERSION} (#{RUBY_RELEASE_DATE})\"\nif ruby_release < '1.8.7' || (ruby_release > '1.8' && ruby_release < '1.9.2')\n abort <<-end_message\n\n Rails 3...
ruby
chosen
[ { "from": "system", "value": "Fix bug in development environment with Invalid single-table inheritance type: Spree::Image\n" }, { "from": "human", "value": "module Spree\n class Image < Asset\n include Configuration::ActiveStorage\n include Rails.application.routes.url_helpers\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Add test for title method in contributors show view\n" }, { "from": "human", "value": "require_relative '../../../../apps/web/views/contributors/show'\n\nRSpec.describe Web::Views::Contributors::Show do\n let(:exposures) { Hash[foo: 'bar'] }\n let(:template) { Ha...
ruby
chosen
[ { "from": "system", "value": "Use -1 instead of Process.maxgroups + 1.\n\nFrom r31034, default value of Process.maxgroups is the max value of the\nenvironment. So it can't increment and use decrement.\n" }, { "from": "human", "value": "require File.expand_path('../../../spec_helper', __FILE__)\n...
ruby
chosen
[ { "from": "system", "value": "Test case used incorrect property file check.\n" }, { "from": "human", "value": "require 'spec_helper.rb'\n\ndescribe 'bitbucket' do\n context 'supported operating systems' do\n on_supported_os.each do |os, facts|\n context \"on #{os} #{facts}\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Add test for default requirements on Shifts\n" }, { "from": "human", "value": "require \"rails_helper\"\n\nRSpec.describe LocationShiftForm, \"#submit\" do\n context \"with valid data submission\" do\n it \"creates a shift from the data submitted\" do\n dat...
ruby
chosen
[ { "from": "system", "value": "Set homepage URL to the gemspec\n" }, { "from": "human", "value": "lib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'declarative/version'\n\nGem::Specification.new do |spec|\n spec.name = \"declar...
ruby
chosen
[ { "from": "system", "value": "Fix wizard sidebar list-group-item to match bootstrap 4.6 documentation\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule EffectiveResourcesWizardHelper\n\n def render_wizard_sidebar(resource, numbers: true, horizontal: false, &block)\n ...
ruby
chosen
[ { "from": "system", "value": "Sort content plans by their reference number\n" }, { "from": "human", "value": "class ContentPlansController < ApplicationController\n expose_decorated(:content_plan, attributes: :content_plan_params)\n expose_decorated(:content_plans) {\n ContentPlanSearch.new...
ruby
chosen
[ { "from": "system", "value": "Add protection for conversation path error handling\n" }, { "from": "human", "value": "class ConversationsController < ApplicationController\n\n respond_to :html, :js\n\n def index\n @conversations = Conversation.involving(current_user)\n end\n\n def create\n...
ruby
chosen
[ { "from": "system", "value": "Add active record specific instantiation logic\n" }, { "from": "human", "value": "module DisablePrefixCheck\n extend ActiveSupport::Concern\n\n module ClassMethods\n def check_prefix_options(options)\n end\n\n # `flexible = true` is hack to allow multiple...
ruby
chosen
[ { "from": "system", "value": "Fix failed test to load social_buttons_book partial\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe SotechshaOverviewPageController, type: :controller, scrivito: true do\n render_views\n\n describe \"GET #index\" do\n it \"set @sts_p...
ruby
chosen
[ { "from": "system", "value": "Update generator to put layouts folder in its new home\n" }, { "from": "human", "value": "class ThemeGenerator < Rails::Generator::NamedBase\n \n def manifest\n record do |m|\n # Theme folder(s)\n m.directory File.join( \"themes\", file_...
ruby
chosen
[ { "from": "system", "value": "Use append_file rather than insert_into file for authentication_helpers hook\n\nIt's not important that this is done before configuration, and therefore can go anywhere in the file\n\nh/t beneggget\n" }, { "from": "human", "value": "module Spree\n class CustomUserG...
ruby
chosen
[ { "from": "system", "value": "Disable cloud network editing and deletion for list view.\n\nNetwork editing is only implemented for OpenStack. So it needs to be\ndisabled for the general case.\n\nFixes https://bugzilla.redhat.com/show_bug.cgi?id=1539723\n" }, { "from": "human", "value": "class Ap...
ruby
chosen
[ { "from": "human", "value": "Add first tests for OP certificate application request\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass OpCertApplicationRequestTest < ActiveSupport::TestCase\n include Sepa::Utilities\n\n setup do\n @op_get_certificate_params = op_get_certificate...
ruby
chosen
[ { "from": "system", "value": "Fix so gem will build\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\n\nGem::Specification.new do |spec|\n spec.name = \"emque-stats\"\n spec.version ...
ruby
chosen
[ { "from": "system", "value": "Add validates presence of user\n" }, { "from": "human", "value": "class EventRegistration < ActiveRecord::Base\n belongs_to :user\n has_and_belongs_to_many :events\n\n validates :name, :college, :token, :amount, presence: true\n\n validates_associated :user\n\n ...
ruby
chosen
[ { "from": "human", "value": "Add the changeset id to the user index so the next/previous user links\ncan be resolved quickly.\n\n\n" }, { "from": "gpt", "value": "class ImproveChangesetUserIndex < ActiveRecord::Migration\n def self.up\n add_index :changesets, [:user_id, :id], :name => \"chan...
ruby
chosen
[ { "from": "system", "value": "Add frozen string literal comment\n" }, { "from": "human", "value": "\nmodule Shipit\n module Api\n class RollbacksController < BaseController\n require_permission :deploy, :stack\n\n params do\n requires :sha, String, length: { in: 6..40 }\n ...
ruby
chosen
[ { "from": "system", "value": "Reduce the number of unnecessary retries.\n" }, { "from": "human", "value": "require 'nokogiri'\nrequire 'open-uri'\n\nclass MALImportWorker\n include Sidekiq::Worker\n\n def perform(mal_username, staged_import_id)\n staged_import = StagedImport.find(staged_imp...
ruby
chosen