conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "human", "value": "Add micropayment field to sign_up_topic\n" }, { "from": "gpt", "value": "class AddMicropaymentToSignUpTopic < ActiveRecord::Migration\n def self.up\n add_column :sign_up_topics, :micropayment, :integer\n end\n\n def self.down\n remove_column :sign_up_topics,...
ruby
chosen
[ { "from": "system", "value": "Remove confusing assignment during inside if statement\n" }, { "from": "human", "value": "module ActiveRecordCacheAllAttributes\n def self.included(base)\n base.extend ClassMethods\n end\n\n module InstanceMethods\n def clear_attribute_cache\n self.cla...
ruby
chosen
[ { "from": "system", "value": "Add missing 'survey_id' field to questions migration\n" }, { "from": "human", "value": "class CreateQuestions < ActiveRecord::Migration\n def change\n create_table :questions do |t|\n t.string :body, null: false\n t.timestamps null: false\n end\n e...
ruby
chosen
[ { "from": "system", "value": "Add - Add twitter SEO\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n\n before_action :prepare_meta_tags\n\n private\n def prepare_meta_tags opts={}\n title = opts[:title]...
ruby
chosen
[ { "from": "human", "value": "Add tests for email api commands.\n" }, { "from": "gpt", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe GithubCLI::Commands::Emails do\n let(:format) { 'table' }\n let(:user) { 'peter-murach' }\n let(:api_class) { GithubCLI::Email }\n\n it \"i...
ruby
chosen
[ { "from": "human", "value": "Add codility training - count factors\n" }, { "from": "gpt", "value": "# 100/100\ndef solution(n)\n return 1 if n == 1\n 2.upto(Math.sqrt(n)).reduce(2) do |factor_count, i|\n if i * i == n\n factor_count + 1\n elsif (n % i).zero?\n factor_count + 2\...
ruby
chosen
[ { "from": "human", "value": "Load a buildr.rb before the first project is defined\n" }, { "from": "gpt", "value": "module Buildr\n module PerBuildCustomization\n module ProjectExtension\n include Extension\n before_define do\n unless @customizations_loaded\n local_c...
ruby
chosen
[ { "from": "system", "value": "Resolve a Chef 13 deprecation warning\n\nSigned-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>\n" }, { "from": "human", "value": "#\n# Cookbook:: nginx\n# Recipe:: common/conf\n#\n# Author:: AJ Christensen <aj@junglist.gen.nz>\n#\n# Copyright::...
ruby
chosen
[ { "from": "system", "value": "Install generator will not append javascript and css\n" }, { "from": "human", "value": "module SpreeTaxonImages\n module Generators\n class InstallGenerator < Rails::Generators::Base\n\n class_option :auto_run_migrations, :type => :boolean, :default => fals...
ruby
chosen
[ { "from": "system", "value": "Convert text columns in the DB to medium text.\n" }, { "from": "human", "value": "class UpdateTextColumnsToMediumText < ActiveRecord::Migration\n def self.up\n# execute \"ALTER TABLE tickets MODIFY data MEDIUMTEXT\"\n end\n\n def self.down\n# execute \"ALTE...
ruby
chosen
[ { "from": "human", "value": "Add a test for ApplicationHelper\n" }, { "from": "gpt", "value": "require \"rails_helper\"\n\ndescribe ApplicationHelper, type: :helper do\n describe \"#page_title\" do\n it \"returns GOV.UK for a normal page\" do\n expect(helper.page_title([\"Test Page\"]))...
ruby
chosen
[ { "from": "system", "value": "Fix broken output in test suite\n" }, { "from": "human", "value": "require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')\n\ndescribe Twat do\n\n it \"Should bail if finger is called without an argument\" do #{{{\n with_config(Fixtures::multiuser_c...
ruby
chosen
[ { "from": "system", "value": "Fix broken test due to missing selector.\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe \"Search form\" do\n before do\n visit '/'\n end\n\n it \"checks if a specific word can be found in the posts title\" do\n @post = FactoryGirl.cre...
ruby
chosen
[ { "from": "human", "value": "Add JoinCourse spec to test multiple roles behavior\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\nrequire 'rails_helper'\n\ndescribe JoinCourse do\n let(:user) { create(:user) }\n let(:classroom_program_course) { create(:course) }\n let(:visiting...
ruby
chosen
[ { "from": "system", "value": "Sort the source files for the CSS fingerprint\n\nFor #493\n" }, { "from": "human", "value": "# This provides a \"fingerprint\" of my CSS files.\n#\n# Roughly speaking, it's a hash of all the Sass files that get smushed\n# together into a single CSS file. This gets ...
ruby
chosen
[ { "from": "system", "value": "Add logfile creation for tests (only when `tee` available)\n" }, { "from": "human", "value": "describe 'VM Life Cycle' do\n it 'starts Linux and Windows VM' do\n expect(`vagrant up`).to include(\n 'linux-box: Machine is booted and ready for use!',\n 'w...
ruby
chosen
[ { "from": "human", "value": "Add tests for admin role\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass Admin::SessionsController < ActionDispatch::IntegrationTest\n include Devise::Test::IntegrationHelpers\n\n test 'is not found when the user is not admin' do\n sign_in people...
ruby
chosen
[ { "from": "system", "value": "Remove pry dependency from gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\n\nGEM_NAME = \"rbkit\"\n\nlib = File.expand_path(\"../lib\", __FILE__)\n$: << lib unless $:.include?(lib)\n\nrequire \"rbkit/version\"\n\nGem::Specification.new do |s|\n...
ruby
chosen
[ { "from": "system", "value": "Fix bug (need to call total on Tms object)\n" }, { "from": "human", "value": "require 'benchmark'\n\ndef benchmark(&block)\n runs = 100\n total = 0\n\n runs.times do \n total += Benchmark.measure(&block) \n end\n\n total / runs \nend\n\ndef with_utf8_file(fi...
ruby
chosen
[ { "from": "human", "value": "Test for custom app configuration\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe APP_CONFIG do\n it \"has OAuth2 configuration\" do\n APP_CONFIG['oauth2']['client_id'].should_not be_nil\n APP_CONFIG['oauth2']['client_secret'].should_not be_...
ruby
chosen
[ { "from": "system", "value": "Sort files to require for coverage reports\n\nDir.glob don't guarantee the order of the files it returns\nFor example we have model in\napp/model/rss_feed.rb and his extension in\napp/model/rss_feed/import_export.rb - there is class\ndefined without inheriting from ApplicationR...
ruby
chosen
[ { "from": "system", "value": "Add elabs dev to gem authors\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'econfig/keychain/version'\n\nGem::Specification.new do |spec|\n spec.name ...
ruby
chosen
[ { "from": "system", "value": "Remove the code that lives in the Endpoint class now\n" }, { "from": "human", "value": "module UsesThis\n module Api\n class BaseGenerator\n def self.generate(site)\n new(site).generate\n end\n\n def initialize(site)\n @site = site\n...
ruby
chosen
[ { "from": "human", "value": "Add feature spec for the tasks route\n" }, { "from": "gpt", "value": "require_relative '../feature_helper'\n\nfeature 'Tasks' do\n around(:each) do |example|\n ActiveRecord::Base.connection.transaction do\n User.create(\n username: 'pesho999',\n ...
ruby
chosen
[ { "from": "human", "value": "Add User Feature Testing & Sign Up Feature Test\n" }, { "from": "gpt", "value": "require 'rails_helper'\nrequire 'capybara/rspec'\n\nRSpec.feature \"Users\", type: :feature do\n\tdescribe \"#sign_up\" do\n \tcontext \"with all fields fill post\" do\n \t\tit \"respo...
ruby
chosen
[ { "from": "system", "value": "Refactor mdTranslator html writer module 'domainItem'\n" }, { "from": "human", "value": "# HTML writer\n# domain item\n\n# History:\n# Stan Smith 2017-04-05 refactored for mdTranslator 2.0\n# \tStan Smith 2015-03-26 original script\n\nmodule ADIWG\n module Mdtran...
ruby
chosen
[ { "from": "system", "value": "Create config dir if not exist\n\nFixes #13\n" }, { "from": "human", "value": "module Aws\n module Session\n module Credentials\n module FileProvider\n # Mixin to store configuration in a YAML file\n module YamlFileProvider\n def [](k...
ruby
chosen
[ { "from": "system", "value": "Bump version and author info" }, { "from": "human", "value": "# encoding: UTF-8\nGem::Specification.new do |s|\n s.platform = Gem::Platform::RUBY\n s.name = 'spree_store_credits'\n s.version = '3.0.0.beta'\n s.summary = 'Store credit as a payme...
ruby
chosen
[ { "from": "system", "value": "Set path relative to __FILE__\n" }, { "from": "human", "value": "load File.expand_path('tasks/nodejs.rake')\n\nbefore \"deploy:create_symlink\", \"nodejs:install_packages\"\n" }, { "from": "gpt", "value": "load File.expand_path('../tasks/nodejs.rake', __...
ruby
chosen
[ { "from": "human", "value": "Add HashWithIndifferentAccess class\nsimilar to the class of the same name provided by core Vagrant, but with merge/merge! methods that act more like the methods from the base Hash class\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire 'vagra...
ruby
chosen
[ { "from": "system", "value": "Remove old condition about glob in Package name for pining\n\nSigned-off-by: Alexey Mochkin <d5c0dd61bcff1773215cbb9c11a2f8fa607afa0f@alukardd.org>\n" }, { "from": "human", "value": "#\n# Cookbook Name:: apt\n# Resource:: preference\n#\n# Copyright 2010-2013, Chef S...
ruby
chosen
[ { "from": "system", "value": "Drop unused directive from gemspec" }, { "from": "human", "value": "lib = File.expand_path(\"../lib\", __FILE__)\n$:.unshift lib unless $:.include? lib\n\nrequire \"savon/multipart/version\"\n\nGem::Specification.new do |s|\n s.name = \"savon-multipart\"\n ...
ruby
chosen
[ { "from": "system", "value": "Print the Rails version we're running against.\n\nWhen the spec starts we print the Rails version so we can\nsee in the logs which version was used for the tests.\n" }, { "from": "human", "value": "# encoding: utf-8\n\n$:.unshift File.expand_path(\"../../lib\", __FI...
ruby
chosen
[ { "from": "system", "value": "Add timezone env variable (for CI)\n" }, { "from": "human", "value": "require 'rspec/rails'\nrequire 'shoulda-matchers'\nrequire 'timecop'\n\nTime.zone = 'Europe/London'\n\n# path relative to the Dummy app, which is by convention at spec/dummy\nDir[Rails.root.join('...
ruby
chosen
[ { "from": "human", "value": "Support for obtaining the latest release number for a Provider\n" }, { "from": "gpt", "value": "require \"json\"\nrequire \"open-uri\"\nrequire \"net/http\"\n\nclass Middleman::HashiCorp::LatestRelease\n\n def self.fetch(product)\n url = \"https://releases.hashic...
ruby
chosen
[ { "from": "system", "value": "Put this back, because of course it broke things\n" }, { "from": "human", "value": "module Neo4j::ActiveNode::Labels\n module Reloading\n extend ActiveSupport::Concern\n\n MODELS_TO_RELOAD = []\n\n def self.reload_models!\n MODELS_TO_RELOAD.each(&:con...
ruby
chosen
[ { "from": "human", "value": "Add code wars 6 lambdas for open closed\n" }, { "from": "gpt", "value": "# http://www.codewars.com/kata/53574972e727385ad10002ca/\n# --- iteration 1 ---\nspoken = ->(greeting) do\n greeting << \".\"\nend\n\nshouted = ->(greeting) do\n greeting.upcase << \"!\"\nend\...
ruby
chosen
[ { "from": "system", "value": "Make sleep_until timeout more forgiving on Travis.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Helper for testing threaded code.\nQUE_TEST_TIMEOUT ||= 2\ndef sleep_until(timeout = QUE_TEST_TIMEOUT)\n deadline = Time.now + timeout\n loop d...
ruby
chosen
[ { "from": "system", "value": "Update Node.js documentation (6.6.0, 4.5.0)\n" }, { "from": "human", "value": "module Docs\n class Node < UrlScraper\n self.name = 'Node.js'\n self.slug = 'node'\n self.type = 'node'\n self.links = {\n home: 'https://nodejs.org/',\n code: 'htt...
ruby
chosen
[ { "from": "human", "value": "Add a test file for BMFF::Box::Movie.\n" }, { "from": "gpt", "value": "# coding: utf-8\n# vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:\n\nrequire_relative '../../minitest_helper'\nrequire 'bmff/box'\nrequire 'stringio'\n\nclass TestBMFFBoxMovie...
ruby
chosen
[ { "from": "human", "value": "Add integration test for TypeSafe, through Relvar.type_safe\n" }, { "from": "gpt", "value": "require 'spec_helper'\nmodule Alf\n describe Relvar, 'type_safe' do\n\n let(:operand){ an_operand.with_heading(status: Integer) }\n let(:relvar) { operand.to_relva...
ruby
chosen
[ { "from": "human", "value": "Improve coverage of QuestionContentText model\n" }, { "from": "gpt", "value": "require 'spec_helper.rb'\ndescribe QuestionContentText do\n it \"should prepare proper new anser of user\" do\n recruit = Factory(:recruit)\n q = Factory(:question)\n Facto...
ruby
chosen
[ { "from": "system", "value": "Format IntelliJ IDEA Ultimate EAP\n" }, { "from": "human", "value": "class IntellijIdeaUltimateEap < Cask\n url 'http://download.jetbrains.com/idea/ideaIU-138.777.dmg'\n homepage 'https://www.jetbrains.com/idea/index.html'\n version '138.777'\n sha256 '0653d9aca...
ruby
chosen
[ { "from": "system", "value": "Update LibreOffice to latest version 4.3.1" }, { "from": "human", "value": "class Libreoffice < Cask\n homepage 'https://www.libreoffice.org/'\n version '4.3.0'\n\n if Hardware::CPU.is_32_bit? or MacOS.version < :mountain_lion\n url \"https://download.document...
ruby
chosen
[ { "from": "human", "value": "Validate the model when returning from an oauth callback if a new spree user is required\n" }, { "from": "gpt", "value": "Spree::UserRegistrationsController.class_eval do\n private\n\n def build_resource(*args)\n super\n if session[:omniauth]\n @user.app...
ruby
chosen
[ { "from": "human", "value": "Add migration to undo Natural England -> RPA migration\n\nThe previous migration was based on incorrect information, only a\nsubset of the Natural England content should be moved to the RPA.\n" }, { "from": "gpt", "value": "old = Organisation.find_by!(slug: 'rural-pa...
ruby
chosen
[ { "from": "human", "value": "Add links to reflection section as comments\n" }, { "from": "gpt", "value": "puts 'Please enter your first name.'\n\tfirst_name = gets.chomp\n\nputs 'Please enter you middle name.'\n\tmiddle_name = gets.chomp\n\nputs 'Now finally, please enter you last name.'\n\tlast...
ruby
chosen
[ { "from": "system", "value": "Fix incorrect translation call (don't put . when scoping)\n" }, { "from": "human", "value": "class SessionsController < Devise::SessionsController\n layout 'login'\n\n before_filter :clear_unauthenticated_flash, :only => [:new]\n\n def create\n super\n rescue...
ruby
chosen
[ { "from": "system", "value": "Use the sha for .tar.gz, not .tar\n" }, { "from": "human", "value": "class Simulator < Formula\n homepage \"https://github.com/davelyon/simulator\"\n url \"https://github.com/davelyon/simulator/archive/v0.1.1.tar.gz\"\n sha256 \"8132b847309f287f285527840b0dff3844...
ruby
chosen
[ { "from": "system", "value": "Fix spec failures related to changed CSS class for calendar display" }, { "from": "human", "value": "module PageObject\n class Component\n class TaskableHeader < PageObject::Component\n\n element :headline, '.title'\n element :description, '.descriptio...
ruby
chosen
[ { "from": "system", "value": "Add pmap reference in pod description\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"ConcurrentCollectionOperations\"\n s.version = \"0.0.2\"\n s.summary = \"Concurrent map and filter on NSArray, NSDictionary, NSSet using G...
ruby
chosen
[ { "from": "system", "value": "Adjust SAP to return error message on failure\n" }, { "from": "human", "value": "module Fuey\n module Inspections\n module Support\n class SAP\n def initialize(config)\n @config = config\n end\n\n def ping\n require 's...
ruby
chosen
[ { "from": "system", "value": "Fix success & order id getters\n" }, { "from": "human", "value": "module OrderBot\n class SubmitOrderResponse < AbstractResponse\n def successful?\n @data[:pl_submit_order_response][:pl_submit_order_result][:order_process_result][:is_success]\n rescue\n ...
ruby
chosen
[ { "from": "human", "value": "Remove user email local part - now unused.\n" }, { "from": "gpt", "value": "class RemoveEmailLocalPartFromUsers < ActiveRecord::Migration\n def self.up\n remove_column :users, :email_local_part\n end\n\n def self.down\n add_column :users, :email_local_part, ...
ruby
chosen
[ { "from": "system", "value": "Revert comment for the drop table\n" }, { "from": "human", "value": "class DropFeaturedProfileTranslations < ActiveRecord::Migration[5.2]\n def change\n # drop_table :featured_profile_translations\n end\nend\n" }, { "from": "gpt", "value": "class Dr...
ruby
chosen
[ { "from": "system", "value": "Simplify logic on date changes\n\nThe logic was way more complicated than it needed to be; if the change\nis to a confirmed date, then the change note is required. There is no\nneed to check exactly what sort of change it is.\n" }, { "from": "human", "value": "class...
ruby
chosen
[ { "from": "system", "value": "Use if rather than unless\n" }, { "from": "human", "value": "Spree::Variant.class_eval do\n after_commit :mailchimp_sync\n\n private\n def mailchimp_sync\n unless product.deleted?\n SolidusMailchimpSync::VariantSynchronizer.new(self).auto_sync\n end\n ...
ruby
chosen
[ { "from": "human", "value": "Add unit specs for projection visitor\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\ndescribe Veritas::Adapter::Arango::Visitor::Projection, '#root' do\n let(:node) { base.project([:bar]) }\n\n subject { object.root }\n\n expect_aql <<-AQL\n FOR `pro...
ruby
chosen
[ { "from": "system", "value": "Update admin/shipments/{index,edit}.html.erb I18n scopes to use shipment_states,\nnot state_names.\n\nFixes #2888\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"Shipments\" do\n stub_authorization!\n\n let!(:order) { OrderWalkthrough.up_to(...
ruby
chosen
[ { "from": "human", "value": "Write tests for Applications Resource.\n\nSimple test for the list endpoint inspired by the existing test created\nfor the Users Resources list endpoint.\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"test_helper\"\n\nclass ApplicationsRe...
ruby
chosen
[ { "from": "system", "value": "Update rubocop requirement from ~> 0.59 to ~> 1.1\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/ruboco...
ruby
chosen
[ { "from": "system", "value": "Remove overhead of having a merge work unit." }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'support', 'document_action')\n\nclass CalculateAspectRatios < DocumentAction\n \n def process\n errors = []\n\n page_numbers = (1..docume...
ruby
chosen
[ { "from": "system", "value": "Use camelize instead of classify." }, { "from": "human", "value": "class CommentsController < ActionController::Base\n \n prepend_before_filter :get_model\n before_filter :get_comment, :only => [:show, :edit, :update]\n\n respond_to :html\n \n def index\n @...
ruby
chosen
[ { "from": "system", "value": "Adjust find_parent to avoid changing params.\n" }, { "from": "human", "value": "class CommentsController < ApplicationController\n #parent_article scoped\n def index\n @article = find_parent\n @comments = @article.comments\n render partial: \"index\"\n e...
ruby
chosen
[ { "from": "system", "value": "Remove haircut location from bubble display\n" }, { "from": "human", "value": "class HaircutsController < MyplaceonlineController\n def may_upload\n true\n end\n\n def use_bubble?\n true\n end\n \n def bubble_text(obj)\n result = nil\n if !obj.cutt...
ruby
chosen
[ { "from": "system", "value": "Implement present helper methods into the projects controller\n" }, { "from": "human", "value": "class ProjectsController < ActionController::Base\r\n \r\n def new\r\n \tif true #current_professor\r\n \t\t#@professor = current_professor\r\n \t\t@students = Stud...
ruby
chosen
[ { "from": "system", "value": "Refactor and remove unused code\n" }, { "from": "human", "value": "require 'pry'\nclass ProjectsController < ApplicationController\n load_and_authorize_resource\n before_action :current_project, only: [:destroy, :edit, :update, :show]\n\n def index\n @genres =...
ruby
chosen
[ { "from": "system", "value": "Remove hacky heroku debugging entirely\n" }, { "from": "human", "value": "class SessionsController < ApplicationController\n\n def create\n auth = request.env[\"omniauth.auth\"]\n if params[:email] and params[:password]\n puts \"<<<<<------ Auth via Emai...
ruby
chosen
[ { "from": "system", "value": "Rename param to avoid mass-assignment warning\n" }, { "from": "human", "value": "# Controller used for simple tracking with GET requests\n\nclass TrackingController < ApplicationController\n before_filter :authenticate_with_token\n before_filter :find_track\n\n d...
ruby
chosen
[ { "from": "system", "value": "Make custom matchers available to ServerSpec tests\n" }, { "from": "human", "value": "module RSpec\n module Core\n #\n module DSL\n def jenkins_credentials(username)\n Serverspec::Type::JenkinsCredentials.new(username)\n end\n\n def jenk...
ruby
chosen
[ { "from": "system", "value": "Upgrade Transporter Desktop.app to v3.0.15\n\nThis PR updates the transporter-desktop cask to v3.0.15 and includes\nthe new SHA.\n" }, { "from": "human", "value": "cask :v1 => 'transporter-desktop' do\n version '2.8.1_16078'\n sha256 '43d0f47993d233fee6209b040b77f...
ruby
chosen
[ { "from": "system", "value": "Add count method on a HashCollection\n\nAdd count method on a HashCollection\n" }, { "from": "human", "value": "class ManageIQ::Providers::Amazon::Inventory::HashCollection\n attr_reader :collection\n\n def initialize(collection)\n @collection = collection\n e...
ruby
chosen
[ { "from": "system", "value": "Add before actions and filter; Add won/lost actions\n" }, { "from": "human", "value": "class GamesController < ApplicationController\n\n def index\n @game = current_user.games.last\n end\n\n def new\n @game = Game.new\n end\n\n def create\n @game = cur...
ruby
chosen
[ { "from": "system", "value": "Fix for game platform names\n" }, { "from": "human", "value": "class PagesController < ApplicationController\n \n def home\n @xbox_one_games = Game.where(platform: \"Microsoft Xbox One\").asc(:title)\n @ps4_games = Game.where(platform: \"Sony Playstation 4\"...
ruby
chosen
[ { "from": "system", "value": "Fix last method, just creating a issue about global var\n" }, { "from": "human", "value": "class PagesController < ApplicationController\n before_action :set_blurbs, only: [:contributors, :home]\n skip_before_filter :if_not_signed_in\n\n def home\n if user_sig...
ruby
chosen
[ { "from": "system", "value": "Normalize the ends and beginnings of days" }, { "from": "human", "value": "class StatsController < ApplicationController\n newrelic_ignore\n\n def index\n period = 7.days.ago\n @new_projects = Project.where('created_at > ?', period).group(\"date(created_at)\...
ruby
chosen
[ { "from": "system", "value": "Use log_in helper upon signup\n" }, { "from": "human", "value": "class UsersController < ApplicationController\n before_action :require_logged_in, only: [:show]\n\n def show\n @user = User.find(params[:id])\n end\n\n def new\n end\n\n def create\n @user ...
ruby
chosen
[ { "from": "human", "value": "Write a little educators importer\n" }, { "from": "gpt", "value": "class EducatorsImporter\n include Connector\n include Importer\n\n def import_row(row)\n educator = Educator.where(local_id: row[:local_id]).first_or_create!\n educator.update_attributes(Hash...
ruby
chosen
[ { "from": "system", "value": "Fix functional Test for add to cart\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass LineItemsControllerTest < ActionController::TestCase\n setup do\n @line_item = line_items(:one)\n end\n\n test \"should get index\" do\n get :index\n as...
ruby
chosen
[ { "from": "system", "value": "Add user authentication in VideosController\n\nalso add 500 status to error handling\n" }, { "from": "human", "value": "class Api::V1::VideosController < ApplicationController\n\n def index\n playlist = Playlist.find_by(id: params[:playlist_id])\n\n if playli...
ruby
chosen
[ { "from": "system", "value": "Add code to get Org from multiple values, the time and space recs are too much and should be refactored\n" }, { "from": "human", "value": "class OrganizationsController < ActionController::API\n def index\n if params.empty?\n @organizations = Or...
ruby
chosen
[ { "from": "system", "value": "Use physical .sqlite3 file instead of in-memory DB\n" }, { "from": "human", "value": "# frozen_string_literal: true\n# database\nActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'\n" }, { "from": "gpt", "value": "# frozen_st...
ruby
chosen
[ { "from": "system", "value": "Remove the screenshots from the Podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'PBWebViewController'\n s.version = '0.2'\n s.summary = 'A light-weight, simple and extendible web browser component for iOS.'\n s.homepa...
ruby
chosen
[ { "from": "system", "value": "Send emails from an email that exists\n\nThis seems to help them get through.\n\nAlso, remove kochiku@ as the default so our future selves don't repeat our mistakes.\n" }, { "from": "human", "value": "class BuildMailer < ActionMailer::Base\n helper :application\n ...
ruby
chosen
[ { "from": "system", "value": "Add feed format for nicer tweets\n" }, { "from": "human", "value": "url = paper_url(body: paper.body, legislative_term: paper.legislative_term, paper: paper)\nfeed.entry paper, published: paper.published_at, updated: paper.updated_at, url: url do |entry|\n # items ...
ruby
chosen
[ { "from": "system", "value": "Add support for markdown tables syntax\n" }, { "from": "human", "value": "module BlogSnippets\n class MarkdownToHTMLTransformer\n\n def initialize(options = {})\n @renderer = options[:renderer]\n @markdown_extensions = options[:markdown_extensions] || ...
ruby
chosen
[ { "from": "system", "value": "Use regexp for gpg method name and class name\n\nScanny use in this place non-case sensitive option to match all kind of\nGPG class names (GPG, GpG, Gpg)\n" }, { "from": "human", "value": "module Scanny\n module Checks\n module SystemTools\n class GpgUsageC...
ruby
chosen
[ { "from": "system", "value": "Add rescue block and language switcher between 'ja' and 'en'\n" }, { "from": "human", "value": "class FeedController < ApplicationController\n include FeedGenerator\n\n def index\n @feeds = FeedGenerator.build_yahoo_biz_rss()\n respond_to do |format|\n ...
ruby
chosen
[ { "from": "system", "value": "Change MxCommonColumnSet to be commentable\n" }, { "from": "human", "value": "class MxCommonColumnSet < ActiveRecord::Base\n unloadable\n\n belongs_to :table_list, class_name: 'MxTableList', foreign_key: :table_list_id\n has_many :header_columns, class_name: 'MxC...
ruby
chosen
[ { "from": "system", "value": "Fix ruby 2.7 deprecation warning\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule HumanAttributeValues\n extend ActiveSupport::Concern\n\n def human_attribute_value(attribute, options = {})\n value = public_send(attribute)\n self.cl...
ruby
chosen
[ { "from": "human", "value": "Add remote tests for SecurePayTech\n\ngit-svn-id: 89097a394f460cc6812eec7e5bafeda513016c99@457 6513ea26-6c20-0410-8a68-89cd7235086d\n" }, { "from": "gpt", "value": "require File.dirname(__FILE__) + '/../test_helper'\n\nclass RemoteSecurePayTechTest < Test::Unit::Test...
ruby
chosen
[ { "from": "system", "value": "Update spec test to check toolbar on Object Storage Managers page\n" }, { "from": "human", "value": "describe EmsObjectStorageController do\n include_examples :shared_examples_for_ems_object_storage_controller, %w(openstack)\n\n describe '#show_list' do\n rende...
ruby
chosen
[ { "from": "system", "value": "Fix feed can support markdown\n" }, { "from": "human", "value": "#encoding: UTF-8\nxml.instruct! :xml, :version => \"1.0\"\nxml.rss :version => \"2.0\" do\n xml.channel do\n xml.title \"George Web Labs\"\n xml.author \"George Chang\"\n xml.description \"Ge...
ruby
chosen
[ { "from": "system", "value": "Update JSON for games list\n" }, { "from": "human", "value": "json.array!(@games) do |game|\n json.extract! game, :current_turn\n json.url game_url(game, format: :json)\nend\n" }, { "from": "gpt", "value": "json.array!(@games) do |game|\n json.extract...
ruby
chosen
[ { "from": "system", "value": "Add missing stop! methods to SingleWorkerStrategy\n" }, { "from": "human", "value": "module Chore\n module Strategy\n class SingleWorkerStrategy \n def initialize(manager)\n @manager = manager\n @worker = nil\n end\n\n def start;end\...
ruby
chosen
[ { "from": "system", "value": "Use 1.8 compatible BigDecimal parsing in PriceSack\n\nFixes this build: https://travis-ci.org/#!/spree/spree/jobs/2701882\n" }, { "from": "human", "value": "require_dependency 'spree/calculator'\n\nmodule Spree\n class Calculator::PriceSack < Calculator\n prefer...
ruby
chosen
[ { "from": "human", "value": "Create backend for group creation\n" }, { "from": "gpt", "value": "module Backend\n module Facts\n extend self\n def create(groupname:, members:)\n group = Group.new\n group.groupname = groupname\n group.users << members\n\n group #TODO: do...
ruby
chosen
[ { "from": "system", "value": "Use specified connection to check update\n" }, { "from": "human", "value": "require \"faraday\"\nrequire \"daimon_skycrawlers/filter/base\"\n\nmodule DaimonSkycrawlers\n module Filter\n class UpdateChecker < Base\n def call(url)\n page = storage.find...
ruby
chosen
[ { "from": "system", "value": "Stop initializing action_link in the constructor\n\nThis follows the pattern set by `output_array` of creating the object as\nand when it's needed, rather than at the offset.\n" }, { "from": "human", "value": "module Coronavirus::Pages\n class SubSectionProcessor\n...
ruby
chosen
[ { "from": "system", "value": "Make valid ip address check more robust and add validation of either ipv6 or ipv4 IP address.\n" }, { "from": "human", "value": "module ParsleySimpleForm\n module Validators\n module IPAddress\n def initialize(options)\n @parsley_name = 'ipaddress'\n...
ruby
chosen