conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Rework parser warning to reliably include names of preferred parsers\n" }, { "from": "human", "value": "module ROXML\n unless const_defined? 'XML_PARSER'\n preferred_parsers = %w[nokogiri libxml]\n parser = preferred_parsers.shift\n begin\n require pa...
ruby
chosen
[ { "from": "system", "value": "Update maintainer e-mail in gemspec\n" }, { "from": "human", "value": "Gem::Specification.new do |s|\n s.name = \"prowl\"\n s.version = \"0.1.3\"\n s.date = \"2009-07-08\"\n s.authors = [\"August Lilleaas\"]\n s.email = \"augustlilleaas@gmail.com\"\n s.rubyfor...
ruby
chosen
[ { "from": "system", "value": "Use proper signature when testing with aws mock\n" }, { "from": "human", "value": "# encoding: utf-8\n\nShindo.tests('AWS | url') do\n\n @expires = DateTime.parse('2013-01-01T00:00:00Z').to_time.utc.to_i\n\n @storage = Fog::Storage.new(\n provider: 'AWS',\n ...
ruby
chosen
[ { "from": "human", "value": "Add Adobe Reader.app (Japanese) v.11.0.00\n\nrefactoring\n" }, { "from": "gpt", "value": "class AdobeReaderJa < Cask\n version '11.0.00'\n sha256 '69f71085799700ecd7e7f59e14095eafc5889e8962ed3a2e84e0a40d3a04d570'\n major_version = version.split('.')[0]\n\n url \"...
ruby
chosen
[ { "from": "system", "value": "Add pending specs for testing when debug bar shouldn't show\n" }, { "from": "human", "value": "require \"rails_helper\"\n\ndescribe HomeController do\n render_views\n\n describe \"GET index\" do\n it \"renders booze debug bar\" do\n get :index\n expec...
ruby
chosen
[ { "from": "system", "value": "Change tests for calling Twilio to sent SMS message" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe FCReminder::Gateways::Twilio do\n subject(:gateway) { FCReminder::Gateways::Twilio.new }\n let(:config) do\n {\n account_sid: \"accound s...
ruby
chosen
[ { "from": "human", "value": "Remove double UTF-8 encoding + extra characters\n\nThis data migration converts UTF-8 double encodings back to the original\nform, and also removes any  characters followed by a space. This\nremoves the vast majority of encoding issues with the new data.\n" }, { "from":...
ruby
chosen
[ { "from": "system", "value": "Replace regular user icon with solid variant\n" }, { "from": "human", "value": "module MenuBarHelper\n def menu_bar_links\n [\n link_to_profile,\n link_to_classroom,\n link_to_bibliotheca,\n solve_discussions_link,\n user_discussions_lin...
ruby
chosen
[ { "from": "system", "value": "Remove else branching that doesn't make sense with unless-condition\n" }, { "from": "human", "value": "class ChangeArtMuseumToMuseumArt < ActiveRecord::Migration\n class LocalNodeType < ActiveRecord::Base\n self.table_name = 'node_types'\n validates :identifi...
ruby
chosen
[ { "from": "system", "value": "Add some helper methods re deck (so that a deck is maintained throughout the entire round)\n" }, { "from": "human", "value": "helpers do\n def current_user #finds user by session id if session exists\n @current_user ||= User.find_by(id: session[:user_id]) #find ...
ruby
chosen
[ { "from": "system", "value": "Use transactions for populating stations\n" }, { "from": "human", "value": "module StationsHelper\n\n def current_song\n Song.last\n end\n\n def process_fill(text)\n stationarray = []\n Song.create\n text.each_line do |block|\n if block.match('st...
ruby
chosen
[ { "from": "system", "value": "Move multi_json to a runtime dependency\n\nShould close #39\n" }, { "from": "human", "value": "dir = File.dirname(__FILE__)\nrequire File.expand_path(File.join(dir, 'lib', 'logglier', 'version'))\n\nGem::Specification.new do |s|\n s.name = 'logglier'\n...
ruby
chosen
[ { "from": "system", "value": "Add destroy method to medical contions controller.\n" }, { "from": "human", "value": "class MedicalConditionsController < ApplicationController\n\n before_action :admin?\n\n def new\n @medical_condition = MedicalCondition.new\n end\n\n def create\n @medica...
ruby
chosen
[ { "from": "system", "value": "Remove use of deprecated find_by_* method\n" }, { "from": "human", "value": "require 'active_model'\n\nmodule SolidusPaypalBraintree\n class TransactionImport\n attr_reader :transaction, :order\n\n def initialize(order, transaction)\n @order = order\n ...
ruby
chosen
[ { "from": "human", "value": "Revert \"Remove the inspec tests for smoke\"\n\nThis reverts commit 508a8cc03921932105fa5c7c345149c4cb312c1d.\n" }, { "from": "gpt", "value": "# service named 'default'\ndescribe command('docker images') do\n its(:exit_status) { should eq 0 }\n its(:stdout) { shou...
ruby
chosen
[ { "from": "system", "value": "Create index on phrase versions to phrase association\n" }, { "from": "human", "value": "class CreatePhrasingPhraseVersions < ActiveRecord::Migration\n def change\n create_table :phrasing_phrase_versions do |t| \n t.integer :phrasing_phrase_id\n t.t...
ruby
chosen
[ { "from": "system", "value": "Use `published_at` date for the feed\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nxml.instruct! :xml, version: '1.0'\n\nxml.rss version: '2.0',\n 'xmlns:media' => 'http://search.yahoo.com/mrss/',\n 'xmlns:atom' => 'http://www.w3....
ruby
chosen
[ { "from": "system", "value": "Move to attr_reader for Arguments methods\n" }, { "from": "human", "value": "module ValidatesType\n # Wrapper class for arguments consumed by validates_with\n class Arguments\n # @initialize\n # param: attribute_name <Symbol> - name of attribute that will ...
ruby
chosen
[ { "from": "system", "value": "Remove relationships where source == target prior to adding relationship type\n" }, { "from": "human", "value": "class AddTypeToRelationships < ActiveRecord::Migration[5.2]\n def up\n add_column :relationships, :type, :string\n\n execute %(update relationship...
ruby
chosen
[ { "from": "human", "value": "Add Statistical Data Set sync checks\n" }, { "from": "gpt", "value": "module SyncChecker\n module Formats\n class StatisticalDataSetCheck < EditionBase\n def root_path\n \"/government/statistical-data-sets/\"\n end\n\n def rendering_app\n ...
ruby
chosen
[ { "from": "system", "value": "Patch old migration that raises now\n" }, { "from": "human", "value": "class CreateEventNoteRevisions < ActiveRecord::Migration[4.2]\n def change\n create_table :event_note_revisions do |t|\n t.integer :student_id\n t.integer :educator_id\n t.inte...
ruby
chosen
[ { "from": "system", "value": "Remove foreign key from promotion_rules_stores\n\nSimilar to the issue with store_shipping_methods, this uses a different\ntype for the primary key than the reference, which is invalid and causes\nan error under MySQL.\n" }, { "from": "human", "value": "class Create...
ruby
chosen
[ { "from": "system", "value": "Fix Country reference in state factory\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :state, :class => Spree::State do\n name 'ALABAMA'\n abbr 'AL'\n country do |country|\n if usa = Country.find_by_numcode(840)\n country = ...
ruby
chosen
[ { "from": "system", "value": "Add chrome w3c capability of whilst errors are being triaged\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'simplecov' unless ENV['CI']\nrequire 'capybara'\nrequire 'capybara/cucumber'\nrequire 'selenium-webdriver'\nrequire 'webdrivers...
ruby
chosen
[ { "from": "system", "value": "Include rake task in gemspec\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'google-oauth2-installed/version'\n\nGem::Specification.new do |spec|\n spe...
ruby
chosen
[ { "from": "system", "value": "Add some more seed data\n" }, { "from": "human", "value": "Merb.logger.info('Seeding development database')\n\nspeccing_page = Page.create! \\\n :name => 'Isolated controller/view specifications', \n :content => 'Coming soon...'\n\nspeccing_page.update_attributes ...
ruby
chosen
[ { "from": "system", "value": "erlang: Fix check for downloaded erlang-solutions .deb\n" }, { "from": "human", "value": "module VagrantPlugins\n module Ventriloquist\n module Cap\n module Debian\n module ErlangInstall\n ERLANG_SOLUTIONS_PKG = \"https://packages.erlang-sol...
ruby
chosen
[ { "from": "system", "value": "Update crypto-square example solution to pass new tests\n" }, { "from": "human", "value": "class Crypto\n\n def initialize(plaintext)\n @plaintext = plaintext\n end\n\n def normalize_plaintext\n @normalized ||= @plaintext.downcase.gsub(/\\W/, '')\n end\n\n...
ruby
chosen
[ { "from": "system", "value": "Use default rails code in templates for now\n" }, { "from": "human", "value": "module StaticErrorPages\n class InstallGenerator < Rails::Generators::Base\n def create_views\n StaticErrorPages.supported_errors.each do |code|\n path = \"app/views/stati...
ruby
chosen
[ { "from": "system", "value": "Add drop table on contacts if exists\n" }, { "from": "human", "value": "class RenameCompanyContactToContact < ActiveRecord::Migration\n def change\n rename_column :notifications, :company_contact_id, :contact_id\n rename_table :company_contacts, :contacts\n ...
ruby
chosen
[ { "from": "human", "value": "Add migration to remove broken variants from open carts\n" }, { "from": "gpt", "value": "class RemoveBrokenVariantsFromCarts < ActiveRecord::Migration\n def up\n # Removes line_items from open carts where the variant has a hard-deleted price\n\n variants_witho...
ruby
chosen
[ { "from": "system", "value": "Create new file in FactoryGirl image to fix tests\n" }, { "from": "human", "value": "FactoryGirl.define do\n factory :transaction do\n sender \n receiver\n activity\n balance\n image\n amount 100\n end\nend\n" }, { "from": "gpt", "val...
ruby
chosen
[ { "from": "system", "value": "Add override to unicorn config\n" }, { "from": "human", "value": "rails_env = ENV['::Rails.env'] || 'production'\n\nworker_processes 2\npreload_app true\ntimeout 180\n\nuser 'app', 'rails'\n\napp_path = File.expand_path(File.dirname(__FILE__) + \"/../../../current\"...
ruby
chosen
[ { "from": "system", "value": "Update to use new fixture filename\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule MITS\n describe Document do\n subject { Document.new('./spec/fixtures/mits.xml', version: 4.1) }\n\n describe '#properties' do\n it 'will return the pro...
ruby
chosen
[ { "from": "system", "value": "Expand specs for match_hook plugin\n" }, { "from": "human", "value": "require_relative \"../spec_helper\"\n\ndescribe \"match hook plugin\" do\n before do\n hooks = 0\n\n app(:bare) do\n plugin :match_hook\n\n match_hook do\n hooks += 1\n ...
ruby
chosen
[ { "from": "system", "value": "Remove leading line from Moor class\n" }, { "from": "human", "value": "\nmodule Pier\n class Moor\n include ::Pier\n\n def initialize(argv)\n @argv = Array.new(argv)\n # TODO: make this a command line option\n @clone_dir = \"/vagrant-nfs/codeba...
ruby
chosen
[ { "from": "system", "value": "Add setDirection method to Ball. Made the setPosition method private.\n" }, { "from": "human", "value": "module Pong\nclass Ball\n\tattr_accessor :x, :y, :radius, :dx, :dy\n\n\tdef initialize(x, y, radius, dx, dy)\n\t\tsetPosition(x, y);\n\t\t@radius = radius\n\t\t@...
ruby
chosen
[ { "from": "system", "value": "Remove comment in spec file\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Spree\ndescribe Api::VariantsController, type: :controller do\n render_views\n\n let(:variants){create_list(:master_variant, 2)}\n before(:each) do\n stub_authentica...
ruby
chosen
[ { "from": "system", "value": "Change description of original logo\n" }, { "from": "human", "value": "attributes :name, :description, :url\n\nnode(:'@type') { \"http://schema.org/Organization\" }\nnode(:'@id' ) { |org| member_url(org.member) }\n\nnode :membership do |org|\n {\n :type ...
ruby
chosen
[ { "from": "system", "value": "Change requested_changes from string to text\n" }, { "from": "human", "value": "class CreatePurgatories < ActiveRecord::Migration\n def change\n create_table :purgatories do |t|\n t.integer :soul_id\n t.string :soul_type\n t.integer :requester_id\...
ruby
chosen
[ { "from": "system", "value": "Fix reference to Spree bug\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Tax Rates\" do\n include AuthenticationHelper\n\n let!(:calculator) { create(:calculator_per_item, calculable: create(:order)) }\n let!(:tax_rate) { create(:tax_rate...
ruby
chosen
[ { "from": "system", "value": "Add bittorrent sync to osx development\n\nThis commit adds bittorrent sync recipe to osx development.\n\n[#4]\n" }, { "from": "human", "value": "include_recipe \"wel_station::github_for_mac\"\ninclude_recipe \"wel_station::homebrew\"\ninclude_recipe \"wel_station::i...
ruby
chosen
[ { "from": "system", "value": "Fix broken split prices migration.\n\nThe migration will attempt to populated spree_prices with\nthe variant price. Unfortunately, since variant price is\nnow delegated to spree_prices, it will come back as 0.\n\nInstead of reading from the variant price method, it's\ngoing to...
ruby
chosen
[ { "from": "system", "value": "Remove extra line from menu link cms component\n" }, { "from": "human", "value": "module Cms\n module Components\n class MenuLink\n include ActiveModel::Model\n attr_accessor :name, :path, :sublinks\n\n def sublinks?\n sublinks.present?\n ...
ruby
chosen
[ { "from": "system", "value": "Add each tag on a new line\n" }, { "from": "human", "value": "module Metamagic\n module HelperMethods\n def meta_tags\n @meta_tags ||= []\n end\n \n def meta(*options)\n # add page specific meta tags\n add_meta_tags options\n end\n ...
ruby
chosen
[ { "from": "human", "value": "Bring payment method controller from spree_backend\n" }, { "from": "gpt", "value": "module Spree\n module Admin\n class PaymentMethodsController < ResourceController\n skip_before_filter :load_resource, :only => [:create]\n before_filter :load_data\n ...
ruby
chosen
[ { "from": "system", "value": "Fix bad admin?, owner? method in controller\n" }, { "from": "human", "value": "module Notifications\n class ApplicationController < ::ApplicationController\n helper_method :current_user, :owner?, :admin?\n\n alias_method :origin_current_user, Notifications.co...
ruby
chosen
[ { "from": "system", "value": "Update content to test change\n" }, { "from": "human", "value": "require \"simple_mvc/version\"\n\nmodule SimpleMVC\n class Application\n def call(env)\n [200, {\"Content-Type\" => \"text/html\"}, ['Hey, there! Its SimpleMVC']]\n end\n end\nend\n" }, ...
ruby
chosen
[ { "from": "human", "value": "CONFIG: Add default to tutorial capacity\n" }, { "from": "gpt", "value": "class AddDefaultToTutorialCapacity < ActiveRecord::Migration\n def change\n Tutorial.where(capacity: nil).update_all(capacity: -1)\n change_column :tutorials, :capacity, :integer, defaul...
ruby
chosen
[ { "from": "system", "value": "Fix constantizing CloudVolume for disable? check\n\nIn some environments Module.const_defined?(\"Namespace::CloudVolume\")\nreturns ::CloudVolume so this check doesn't work.\nModule.const_defined?(\"ManageIQ::Providers::Amazon::CloudManager::CloudVolume\")\nreturns true then in...
ruby
chosen
[ { "from": "system", "value": "Use an anonymous class to avoid test contamination\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe WebServerWorkerMixin do\n it \"build_uri (ipv6)\" do\n class TestClass\n include WebServerWorkerMixin\n end\n\n TestClass.stub(:bin...
ruby
chosen
[ { "from": "system", "value": "Add a test that cancels a blocking consumer\n" }, { "from": "human", "value": "require \"spec_helper\"\n\ndescribe 'A consumer' do\n let(:connection) { HotBunnies.connect }\n\n after :each do\n connection.close\n end\n\n it 'receives messages until cancelled'...
ruby
chosen
[ { "from": "system", "value": "Fix yard doc of carton mailer\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule Spree\n class CartonMailer < BaseMailer\n # Send an email to customers to notify that an individual carton has been\n # shipped. If a carton contains item...
ruby
chosen
[ { "from": "system", "value": "Fix defaults assignement in Request\n\nUsing #merge does not override options already set\n" }, { "from": "human", "value": "require 'spree-api-client/error'\n\nmodule Spree\n module API\n class Client\n module Request\n def request(method, path, opt...
ruby
chosen
[ { "from": "system", "value": "Update DEVONthink Pro Office to 2.8.6\n" }, { "from": "human", "value": "cask :v1 => 'devonthink-pro-office' do\n version '2.8.6'\n sha256 'a9229681cb57738bc89f7e74c1f42a1e60689b03345f5c9540f239e43b66a449'\n\n # amazonaws.com is the official download host per the...
ruby
chosen
[ { "from": "system", "value": "Add link to Dribbble Set Tag for reference for _config.yml stuff for Suggested Tweet plugin.\n" }, { "from": "human", "value": "# A Liquid tag for Jekyll that allows for the embedding of suggested tweets.\n#\n# Author: David Ensinger\n# Source URL: Forthcoming\n#\n#...
ruby
chosen
[ { "from": "system", "value": "Use submodules for actions for ConnectTokens.\n" }, { "from": "human", "value": "module ContextIO\n class ConnectToken < APIResource\n def self.all\n attr_hashes = ContextIO::API.request(:get, 'connect_tokens')\n\n attr_hashes.map do |attr_hash|\n ...
ruby
chosen
[ { "from": "system", "value": "Return false if rake file isn't found" }, { "from": "human", "value": "require \"language_pack\"\nrequire \"language_pack/jekyll\"\n\n# Octopress Language Pack.\nclass LanguagePack::Octopress < LanguagePack::Jekyll\n\n def self.use?\n super && has_generate_task?...
ruby
chosen
[ { "from": "system", "value": "Include missing method from shoulda.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe StaticPagesController do\n\n context \"GET to about\" do\n before do\n get :about\n end\n\n it { should respond_with :success }\n it { should ...
ruby
chosen
[ { "from": "system", "value": "Remove spec for scenario that doesn't exist in the project (no headers in CSV export file)\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe CsvTransformer do\n\n describe '#transform' do\n context 'with good data' do\n context 'he...
ruby
chosen
[ { "from": "human", "value": "Add boolean for allowing group members to load files to a group\n" }, { "from": "gpt", "value": "class AddGroupMembersCanContribute < ActiveRecord::Migration\n def self.up\n add_column :groups, :members_can_contribute, :boolean, :default => false\n end\n\n def ...
ruby
chosen
[ { "from": "system", "value": "Add tests for attached disk objects\n" }, { "from": "human", "value": "require \"helpers/integration_test_helper\"\nrequire \"integration/factories/disks_factory\"\n\nclass TestDisks < FogIntegrationTest\n include TestCollection\n\n def setup\n @subject = Fog::...
ruby
chosen
[ { "from": "system", "value": "Fix undefined method template for RUBY > 1.9\n" }, { "from": "human", "value": "require 'test/unit/assertions'\n\n# The default template string contains what was sent and received. Strip \n# these out since we don't need them\nunless RUBY_VERSION =~ /^1.9/\n modu...
ruby
chosen
[ { "from": "system", "value": "Fix another typo with class 2 exercise 4\n" }, { "from": "human", "value": "# 5 points\n#\n# Write a program that asks for a person's first name, then middle name, and\n# then last name. Finally, it greets the person using their full name.\n#\n# Here's how the progr...
ruby
chosen
[ { "from": "system", "value": "Add validation and make partner idan accessible attribute\n" }, { "from": "human", "value": "class Employment < ActiveRecord::Base\n belongs_to :partner\n belongs_to :professional\n\n attr_accessible :role\nend\n" }, { "from": "gpt", "value": "class E...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.6.0.0 to 0.6.1.0\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'messaging'\n s.version = '0.6.0.0'\n s.summary = 'Messaging primitives for Eventide'\n s.description = ' ...
ruby
chosen
[ { "from": "system", "value": "Add comment why we include rubygems\n" }, { "from": "human", "value": "module CoppereggAgents\n require 'rubygems'\n\n require 'copperegg'\n require 'yaml'\n require 'logger'\n require 'socket'\n\n require 'copperegg_agents/version'\n require 'copperegg_agent...
ruby
chosen
[ { "from": "system", "value": "Add YARD docs for Decision.new\n" }, { "from": "human", "value": "# A Decision is a single node in a decision tree. It's responsible for choosing the next node based on the given set of facts.\nclass Factree::Decision\n # The names of the facts required to make thi...
ruby
chosen
[ { "from": "system", "value": "Clean up TODOs for GVariant\n" }, { "from": "human", "value": "# frozen_string_literal: true\nGLib.load_class :Variant\n\nmodule GLib\n # Overrides for GVariant, GLib's variant data type.\n class Variant\n setup_instance_method 'get_string'\n\n def get_strin...
ruby
chosen
[ { "from": "system", "value": "Remove development dependency on autotest\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"modelish/version\"\n\nGem::Specification.new do |s|\n s.name = \"modelish\"\n s.version = M...
ruby
chosen
[ { "from": "system", "value": "Allow to skip RuboCop cop classes\n\nDo not check for parameters alignment.\n" }, { "from": "human", "value": "require 'rubocop'\n\nmodule Codegrade\n\tmodule Grader\n\t\tclass Rubocop\n attr_reader :config_store, :file\n\n def initialize(file)\n @c...
ruby
chosen
[ { "from": "human", "value": "Add new database entry for NYC_CFEM delivery location.\n" }, { "from": "gpt", "value": "class AddNewDeliveryLocation < ActiveRecord::Migration\n def change\n # Add new row for NYC-CFEM program\n BlacklightCornellRequests::Circ_policy_locs.create :CIRC_GROUP_ID...
ruby
chosen
[ { "from": "human", "value": "Add migration for choice_users table\n" }, { "from": "gpt", "value": "class CreateChoiceUsersTable < ActiveRecord::Migration\n def change\n create_table :choice_users do |t|\n t.references :choice, null: false\n t.references :user, null: false\n end\...
ruby
chosen
[ { "from": "human", "value": "Build Tradevan Result Object Class\n" }, { "from": "gpt", "value": "module Einvoice\n module Tradevan\n class Result < Einvoice::Result\n def errors\n if response.is_a? ActiveModel::Errors\n response.full_messages.join('; ')\n else\n ...
ruby
chosen
[ { "from": "system", "value": "Change condition order to check encodeable objects.\n" }, { "from": "human", "value": "module Rollbar\n module Encoding\n class << self\n attr_accessor :encoding_class\n end\n\n def self.encode(object)\n can_be_encoded = object.is_a?(Symbol) || o...
ruby
chosen
[ { "from": "system", "value": "[aws|iam] Fix Users model to comply with updated request parameter set" }, { "from": "human", "value": "require 'fog/core/collection'\nrequire 'fog/aws/models/iam/user'\n\nmodule Fog\n module AWS\n class IAM\n\n class Users < Fog::Collection\n\n mode...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation re: encrypted attribute\n\n```\nDEPRECATION WARNING: ssn is not an attribute known to Active Record.\nThis behavior is deprecated and will be removed in the next version of\nRails. If you'd like ssn to be managed by Active Record, add `attribute :ssn to your cla...
ruby
chosen
[ { "from": "system", "value": "Allow the count and duration of truncation tasks to be adjusted\n" }, { "from": "human", "value": "namespace \"truncate\" do\n desc \"Truncate Payload Log Entries that are older than a certain date or successful (Default: 3 days ago)\"\n task :payload_log_entries ...
ruby
chosen
[ { "from": "system", "value": "Make user agent a class constant\n" }, { "from": "human", "value": "require 'unirest'\n\nmodule USaidWat\n module Service\n class RedditService\n def user(username)\n data = {}\n %w{about comments submitted}.each do |page|\n url = \"h...
ruby
chosen
[ { "from": "system", "value": "Fix ns_ is defined in fast_gettext\n" }, { "from": "human", "value": "# Weird Hack on ActionController constant error\nmodule ActionController\nend\nrequire 'gettext_i18n_rails'\nrequire 'gettext_column_mapping/helpers/fast_gettext'\nmodule GettextColumnMapping\n m...
ruby
chosen
[ { "from": "system", "value": "Fix version condition for Active Admin >= 1.0\n\nA regular expressions is used to check whether to use the new\n`ActiveAdmin::ResourceDSL`. This regular expression did not support\nactive admin version > 0.9.\n\nNow it uses `ActiveAdmin::ResourceDSL` by default and uses the old...
ruby
chosen
[ { "from": "system", "value": "Make check conditional to Rails version\n\nThis PR depends on action_dispatch.show_detailed_exceptions being set,\nwhich was only introduced in Rails 3.2.1.\n\nHere we introduce a conditional check based on the required Rails\nversion in order to ensure backwards compatibility....
ruby
chosen
[ { "from": "system", "value": "Make StaticAssets comply to rack spec\n" }, { "from": "human", "value": "require 'digest/md5'\n\nmodule Iridium\n module Middleware\n class StaticAssets\n STATIC_EXTENSIONS = %w(js css jpeg jpg png html)\n\n def initialize(app, root, cache_control)\n ...
ruby
chosen
[ { "from": "human", "value": "Add new caller for a merged macs, no IDR\n" }, { "from": "gpt", "value": "# Copyright (c) 2014, Stuart Glenn, OMRF\n# Distributed under a BSD 3-Clause\n# Full license available in LICENSE.txt distributed with this software\n\nclass Optical::PeakCaller::MacsMerged < O...
ruby
chosen
[ { "from": "system", "value": "Fix compat with liquid 2.5.2\n" }, { "from": "human", "value": "module Solid\n module LiquidExtensions\n class Variable < ::Liquid::Variable\n extend ClassHighjacker\n\n def initialize(markup)\n super\n @expression = Solid::Parser.parse(@...
ruby
chosen
[ { "from": "human", "value": "Rename PropagateInstances class to PropagateService.\n" }, { "from": "gpt", "value": "module Wakame\n module Actions\n class PropagateService < Action\n\n def initialize(svc, host_id=nil)\n raise ArgumentError unless svc.is_a?(Wakame::Service::Service...
ruby
chosen
[ { "from": "human", "value": "Set pkgutil as default package provider on Solaris systems\n" }, { "from": "gpt", "value": "#\n# Copyright 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 Lic...
ruby
chosen
[ { "from": "system", "value": "Update test for correct results\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\nresult = `sass scss/color-claim.scss built.css`\nraise result unless $?.to_i == 0\nraise \"When compiled the module should output some CSS\" unless File.exists?('built.css')\nput...
ruby
chosen
[ { "from": "system", "value": "Update Rubocop to fix 2.6-compat\n" }, { "from": "human", "value": "lib = File.expand_path('lib', __dir__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'influxdb/version'\n\nGem::Specification.new do |spec|\n spec.name = \"influxdb\"\n...
ruby
chosen
[ { "from": "system", "value": "Make cucumbers be executable from dummy's parent directory.\n" }, { "from": "human", "value": "class IntegrationSessionsController < ActionController::Base\n def new\n @user_id = params[:user_id]\n render 'features/support/integration_sessions_form', layout: ...
ruby
chosen
[ { "from": "system", "value": "Update the Markdown helper to support new Tilt.\n\nBetween previous versions of Tilt and now, the API changed slightly. It also\nrequires pulling in the specific renderer.\n" }, { "from": "human", "value": "#\n# Register a custom subclass of Redcarpet which enabled ...
ruby
chosen
[ { "from": "system", "value": "Simplify Backtrace::Tracer; fix regression after refactoring trace hooks\n" }, { "from": "human", "value": "# frozen_string_literal: true\nmodule GraphQL\n class Backtrace\n module Tracer\n module_function\n\n # Implement the {GraphQL::Tracing} API.\n ...
ruby
chosen
[ { "from": "system", "value": "Add myself to authors in gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'ipinfodb/version'\n\nGem::Specification.new do |gem|\n gem.name = \"ipinfodb\"\n gem.version = Ipinfo...
ruby
chosen
[ { "from": "human", "value": "Add tests for zip finalizer\n" }, { "from": "gpt", "value": "require \"./lib/roger/release/finalizers/zip\"\nrequire \"test/unit\"\nrequire \"mocha/test_unit\"\nrequire \"tmpdir\"\n\n# Test for Roger Zip finalizer\nclass ZipTest < Test::Unit::TestCase\n def setup\n ...
ruby
chosen
[ { "from": "system", "value": "Add type field in attachments\n" }, { "from": "human", "value": "class CreateSocialStreamAttachments < ActiveRecord::Migration\n \n def self.up\n create_table \"attachments\", :force => true do |t|\n t.integer \"activity_object_id\"\n t.datetime \"cr...
ruby
chosen
[ { "from": "system", "value": "Rename :leaders attribute to :leader_names\n\nThis make it clearer that it's an array of leader names, not of leader\nobjects.\n" }, { "from": "human", "value": "class Record\n attr_accessor :created_at, :meeting_date, :club_name, :leaders, :attendance,\n ...
ruby
chosen
[ { "from": "system", "value": "Remove rendered js from controller.\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n def create\n @comment = Comment.new(comment_params.except(:username, :date))\n @comment.user_id = current_user.id\n\n if @comment.save...
ruby
chosen
[ { "from": "system", "value": "Set OrderPromotion IDs rather then Promotion IDs for Cart serializer\n" }, { "from": "human", "value": "module Spree\n module V2\n module Storefront\n class CartSerializer < BaseSerializer\n set_type :cart\n\n attributes :number, :item_total, ...
ruby
chosen
[ { "from": "system", "value": "Check the AttachmentData is non-nil before trying to mutate it\n" }, { "from": "human", "value": "class AssetManagerCreateWhitehallAssetWorker < WorkerBase\n include AssetManagerWorkerHelper\n\n sidekiq_options queue: 'asset_manager'\n\n def perform(file_path, le...
ruby
chosen
[ { "from": "system", "value": "Save order to database, display \"thank you\"\n" }, { "from": "human", "value": "#encoding: utf-8\nrequire 'rubygems'\nrequire 'sinatra'\nrequire 'sinatra/reloader'\nrequire 'sinatra/activerecord'\n\nset :database, \"sqlite3:pizzashop.db\"\n\nclass Product < ActiveR...
ruby
chosen