conversations listlengths 2 3 | source stringclasses 1
value | stack stringclasses 1
value |
|---|---|---|
[
{
"from": "system",
"value": "Change trivial reader method to attr_reader\n"
},
{
"from": "human",
"value": "class Ticket\n def initialize(request, params)\n authorise(request)\n @params = params\n end\n\n def email\n @email ||= params[:email]\n end\n\n private\n\n def params\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix Rails 6.1 deprecation on class method scopes\n\nFix the following deprecation warning:\n\n Class level methods will no longer inherit scoping from `inactive` in\n Rails 6.1. To continue using the scoped relation, pass it into the block\n directly. To instead access... | ruby | chosen |
[
{
"from": "system",
"value": "Add todo for item_type for Goods table\n"
},
{
"from": "human",
"value": "class Good < ActiveRecord::Base\n validates :name, presence: true\n validates :price, numericality: { greater_than_or_equal_to: 0 }\n validates :amount, numericality: { only_integer: true, ... | ruby | chosen |
[
{
"from": "system",
"value": "Use blank rather than nil for avatar url\n"
},
{
"from": "human",
"value": "class User < ActiveRecord::Base\n has_and_belongs_to_many :repositories, -> { order 'name ASC' }, uniq: true\n has_and_belongs_to_many :organizations, -> { order 'name ASC' }, uniq: true\n... | ruby | chosen |
[
{
"from": "system",
"value": "Fix specs: clear cached connection between specs\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Dynamoid::Config do\n describe 'credentials' do\n it 'passes credentials to a client connection', config: {\n credentials: Aws::Credentials... | ruby | chosen |
[
{
"from": "system",
"value": "Improve test for province factory rollover\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe Province, type: :model do\n\n it 'should have a valid factory' do\n expect(build_stubbed :province).to be_valid\n end\n\n it 'should be able to cal... | ruby | chosen |
[
{
"from": "human",
"value": "Create answers controller spec with some tests\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\ndescribe AnswersController do\n let(:user) {FactoryGirl.create(:user)}\n\n let(:answer_attributes) { FactoryGirl.build(:answer).attributes }\n # let(:answer) ... | ruby | chosen |
[
{
"from": "system",
"value": "Use carrierwave directory name for subdomain\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe CoverImageUploader do\n\n def fixture_image\n File.open(File.join(Rails.root, '/spec/fixtures/images/transparent.png'))\n end\n\n let(:cover_image... | ruby | chosen |
[
{
"from": "system",
"value": "Add message expectation on log output\n\nSetting a message expectation for the log output checks that the\nexception has been rescued, a message gets logged and reduces\ntest output noise.\n"
},
{
"from": "human",
"value": "require \"rails_helper\"\n\nRSpec.describe... | ruby | chosen |
[
{
"from": "system",
"value": "Add development dependencies to gemspec\n"
},
{
"from": "human",
"value": "require File.expand_path('../lib/apple_push/version', __FILE__)\n\nGem::Specification.new do |s|\n s.name = \"apple_push\"\n s.version = ApplePush::VERSION.dup\n s.summary =... | ruby | chosen |
[
{
"from": "system",
"value": "Set webhooks in initializer for random number generator\n"
},
{
"from": "human",
"value": "require_relative '../lib/webhooks'\n\nclass RandomNumberGenerator\n include Webhooks\n\n def webhooks\n %w{http://localhost:9000}\n end\n\n def generate\n random_num... | ruby | chosen |
[
{
"from": "system",
"value": "Use sexy Rails 3 validation for ProductProperty\n"
},
{
"from": "human",
"value": "module Spree\n class ProductProperty < ActiveRecord::Base\n belongs_to :product\n belongs_to :property\n\n validates :property, :presence => true\n validates_length_of :v... | ruby | chosen |
[
{
"from": "human",
"value": "Add Beaker Notebook (Electron build) v1.4.2-0-ge55c059\n"
},
{
"from": "gpt",
"value": "cask 'beaker-electron' do\n version '1.4.2-0-ge55c059'\n sha256 '32d6ecf6a1ebfc32c3e1b2dfc1edb33eaeab6f83d3f9d74dd9b64e08bd24e3e6'\n\n # cloudfront.net is the official download... | ruby | chosen |
[
{
"from": "system",
"value": "Add no-sandbox option to headless chrome driver\n\nIt looks as if heroku needs this option set in order for it to run on\ntheir dynos\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nrequire \"find_chrome\"\n\nCapybara.register_driver :headless_ch... | ruby | chosen |
[
{
"from": "system",
"value": "KSP-2439: Add ability to create ad accounts via business manager\n"
},
{
"from": "human",
"value": "module FbGraph\n module Connections\n module AdAccounts\n def ad_accounts(options = {})\n ad_accounts = self.connection :adaccounts, options\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Allow all email to be silenced with STOP_ALL_EMAIL\n"
},
{
"from": "human",
"value": "Canary::App.controllers :page do\n\n get :index, :map => \"/#{ENV['BASE_CANARY_PATH']}/:page_name\" do\n @page_name = params[:page_name]\n deliver(:hit_notifier, :hit_email,... | ruby | chosen |
[
{
"from": "human",
"value": "Add challenge solution and reflection\n"
},
{
"from": "gpt",
"value": "#Create a new list:\n#Input: a list of grocery items and quantities\n#Create a new hash\n#Add an item and quantity to the existing list:\n#Create a key/value pair and add it to the hash\n#Remove a... | ruby | chosen |
[
{
"from": "system",
"value": "Update platform-api requirement from >= 2.0, < 2.3 to >= 2.0, < 3.1\n\nUpdates the requirements on [platform-api](https://github.com/heroku/platform-api) to permit the latest version.\n- [Release notes](https://github.com/heroku/platform-api/releases)\n- [Changelog](https://git... | ruby | chosen |
[
{
"from": "system",
"value": "Add issue reference to accept_confirm workaround\n"
},
{
"from": "human",
"value": "# spec/support/features/confirmation.rb\n# TODO: Delete this module when `#accept_confirm` supported by capybara w/ chrome\nmodule Features\n module Confirmation\n def accept_con... | ruby | chosen |
[
{
"from": "system",
"value": "Change 'o' --> 'p' in the word 'sorout' inside attributes/nirous.rb"
},
{
"from": "human",
"value": "default['sprout']['nitrous']['source'] = 'https://www.nitrous.io/mac/Nitrous-Mac-Latest.zip'\ndefault['sorout']['nitrous']['checksum'] = '8eb4407cd0b327e1e9fbdd1ee... | ruby | chosen |
[
{
"from": "human",
"value": "Add test to check the proper parsability of CHANGES.yml\n\ngit-svn-id: 3b1ff1236863b4d63a22e4dae568675c2e247730@573430 13f79535-47bb-0310-9956-ffa450edef68\n"
},
{
"from": "gpt",
"value": "# The ASF licenses this file to You under the Apache License, Version 2.0\n# (... | ruby | chosen |
[
{
"from": "system",
"value": "Remove Java Buildpack from version\n\n- Pivnet adds this\n\nCo-authored-by: Danny Joyce <656eadb1608d5e3ea5db131e513d97abdf96b075@pivotal.io>\n"
},
{
"from": "human",
"value": "#!/usr/bin/env ruby\n\nrequire_relative 'buildpack-bosh-release-updater'\n\n\nversions = ... | ruby | chosen |
[
{
"from": "system",
"value": "Fix request test to check correct user_request\n"
},
{
"from": "human",
"value": "require 'test_helper'\n\nclass UserRequestTest < ActiveSupport::TestCase\n\n test 'uniqueness of pending request' do\n user_request = UserRequest.new(\n team: teams(:team_on... | ruby | chosen |
[
{
"from": "system",
"value": "Add public_stories to the base model to use in series, networks, and accounts\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nclass BaseModel < ActiveRecord::Base\n self.abstract_class = true\n\n include RepresentedModel\n\n def id_from_url(url)\n Rail... | ruby | chosen |
[
{
"from": "system",
"value": "Fix unlock for Redlock adapter\n\nWhen lock is deserialized, it is hash containing strings as keys.\nThough, Redlock expects lock to have Symbols as keys.\nHence, the job is completed without releasing a lock.\n\nThis might be valid for other adapters. (I have not checked it)\n... | ruby | chosen |
[
{
"from": "human",
"value": "Add a tool to edit the format of log messages\n"
},
{
"from": "gpt",
"value": "#!/usr/bin/env ruby\n\n[\"debug\", \"info\", \"warning\", \"warn\", \"exception\", \"error\", \"critical\"].each do |level|\n # Try to automatically clean up a bit first\n system(%{for F... | ruby | chosen |
[
{
"from": "system",
"value": "Bump version to 0.7.0 and add dependency on mainline ISO8601DateFormatter\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = 'ISO8601DateFormatterValueTransformer'\n s.version = '0.5.0'\n s.license = 'Apache2'\n s.summary = 'A small librar... | ruby | chosen |
[
{
"from": "system",
"value": "Reduce the Sentry sampling to 5%\n\nSee https://ministryofjustice.github.io/operations-engineering/documentation/services/sentry.html#sentry-io\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nif Rails.env.eql?('production') && ENV['SENTRY_DSN'].p... | ruby | chosen |
[
{
"from": "system",
"value": "Add active record code to reset primary id count in database\n"
},
{
"from": "human",
"value": "require \"faker\"\n\nUser.delete_all\nPotluck.delete_all\nAttendance.delete_all\n\n20.times do\n User.create(email: Faker::Internet.free_email, username: Faker::Name.fir... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec to match release\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'devise-2fa/version'\n\nGem::Specification.new do |gem|\n gem.... | ruby | chosen |
[
{
"from": "human",
"value": "Add basic code to begin\n"
},
{
"from": "gpt",
"value": "class Settings < Settingslogic\n source \"#{Rails.root}/config/application.yml\"\n namespace Rails.env\n load!\nend\n\nrequire 'sinatra'\nrequire 'sequel'\n\npost '/auth' do\n\nend\n\nget '/tournaments' do\n... | ruby | chosen |
[
{
"from": "system",
"value": "Add math module to built ins\n"
},
{
"from": "human",
"value": "class Env\n def self.global\n env = {}\n [:+, :*].each do |op|\n env[op] = lambda {|*args| args.reduce(op)}\n end\n [:-, :/].each do |op|\n env[op] = lambda {|a, b| a.send(op, b)}... | ruby | chosen |
[
{
"from": "system",
"value": "Remove commented-out line from gemspec\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = \"cancan\"\n s.version = \"1.4.0\"\n s.author = \"Ryan Bates\"\n s.email = \"ryan@railscasts.com\"\n s.homepage = \"http:... | ruby | chosen |
[
{
"from": "system",
"value": "Use welsh minutes message where appropriate\n\nTweak migration to use welsh when the edition is welsh\n"
},
{
"from": "human",
"value": "class MoveMinutesToCompleteToNeedToKnowField < Mongoid::Migration\n def self.up\n Edition.where(:minutes_to_complete.ne => \"... | ruby | chosen |
[
{
"from": "system",
"value": "Fix method which places colocated schools w charters in csv\n"
},
{
"from": "human",
"value": "def create_colocated_schools_ary(schools_hsh)\n\tcolocated_addresses_w_charter = []\n\tcharters_colocation = open_csv(\"csv/colocated-charters-and-schools.csv\")\n\tschool... | ruby | chosen |
[
{
"from": "system",
"value": "Add ruby version requirement to 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 'formdata/version'\n\nGem::Specification.new do |spec|\n spec.na... | ruby | chosen |
[
{
"from": "system",
"value": "Fix intermittent asset failure in specs\n\nResolves #1528\n - Mock relative root in application helper specs\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe ApplicationHelper, type: :helper do\n describe '.paperclip_full_url' do\n it \"when... | ruby | chosen |
[
{
"from": "system",
"value": "[Podspec] Set minimum platform to match ReactiveCocoa\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |spec|\n spec.name = 'ReactiveQueryKit'\n spec.version = '0.1.0'\n spec.summary = 'ReactiveCocoa extensions for QueryKit.'\n spec.homepage = 'http://queryki... | ruby | chosen |
[
{
"from": "system",
"value": "Add warning when out of jokes\n"
},
{
"from": "human",
"value": "require 'erb'\nrequire 'ostruct'\n\ndef read_jokes\n IO.readlines('jokes.txt')\nend\n\ndef template(joke)\n ERB.new(File.read('post-template.erb'))\n .result(OpenStruct.new({joke: joke}).instance_... | ruby | chosen |
[
{
"from": "human",
"value": "Add test coverage for ITSIAuthoring::Editor.\n\n"
},
{
"from": "gpt",
"value": "require \"spec_helper\"\n\ndescribe ITSIAuthoring::Editor do\n let(:author) { FactoryGirl.create(:author) }\n let(:activity) {\n activity = FactoryGirl.create(:activity)\... | ruby | chosen |
[
{
"from": "system",
"value": "Refactor SubmissionRejector's rules and their specs\n"
},
{
"from": "human",
"value": "require 'rails_helper'\n\ndescribe Rules::FirstTimeRule do\n describe '#broken?' do\n subject { described_class.new.broken?(submission) }\n\n context 'when the applicant ha... | ruby | chosen |
[
{
"from": "human",
"value": "Add rake task to update changesets\n"
},
{
"from": "gpt",
"value": "\ndesc \"Update Pre-changeset version objects with changeset data\"\nnamespace :paper_trail do\n task :rebuild_changesets => :environment do\n [Note, Topic, Question, Answer].each do |klass|\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add Migration Table to ID Coaches Working on Questions\n"
},
{
"from": "gpt",
"value": "class CreateActiveQuestions < ActiveRecord::Migration\n def change\n create_table :active_questions do |t|\n t.references :user, null: true\n t.references :question,... | ruby | chosen |
[
{
"from": "human",
"value": "Add logger example with validation\n"
},
{
"from": "gpt",
"value": "require 'spec_helper'\n\nclass Logger\n alias :m :method\n\n def initialize(repository)\n @repository = repository\n end\n\n def log(item)\n validate(item) >> m(:transform) >= m... | ruby | chosen |
[
{
"from": "system",
"value": "Sort single board posts properly\n"
},
{
"from": "human",
"value": "class BoardsController < ApplicationController\n before_filter :login_required, :only => :new\n before_filter :set_available_cowriters, :only => :new\n\n def index\n @page_title = \"Continuiti... | ruby | chosen |
[
{
"from": "system",
"value": "Order events newest to oldest\n"
},
{
"from": "human",
"value": "class EventsController < ApplicationController\n before_action :set_event, except: [:index, :new, :create]\n\n def index\n @events = Event.all\n @current = Event.current\n end\n\n def new\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Create specs for category model\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Category do\n describe \"Associations\" do\n before do\n FactoryGirl.create :category\n end\n\n it{ should have_many :projects }\n it{ should valid... | ruby | chosen |
[
{
"from": "system",
"value": "Enable BASIC Auth for CoderDojo Spaces :secret:\n"
},
{
"from": "human",
"value": "class SpacesController < ApplicationController\n # http_basic_authenticate_with name: ENV['SPACES_BASIC_AUTH_NAME'], password: ENV['SPACES_BASIC_AUTH_PASSWORD'] if Rails.env.producti... | ruby | chosen |
[
{
"from": "system",
"value": "Make it work on rails 5\n"
},
{
"from": "human",
"value": "module Adhoq\n module AuthorizationMethods\n extend ActiveSupport::Concern\n\n included do |controller|\n controller.before_filter Authorizer.new\n\n helper_method :adhoq_current_user\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add zoom and dpi values to correct the pdf display when environment is not development.\n"
},
{
"from": "human",
"value": "class Dashboard::PosterController < Dashboard::BaseController\n def index\n authorize! :manage_poster, proposal\n\n respond_to do |forma... | ruby | chosen |
[
{
"from": "system",
"value": "Fix edge case and some specs in post checkout actions\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\n# Executes actions after checkout\nmodule Checkout\n class PostCheckoutActions\n def initialize(order)\n @order = order\n end\n\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Update rspec requirement from ~> 3.8.0 to ~> 3.9.0\n\nUpdates the requirements on [rspec](https://github.com/rspec/rspec) to permit the latest version.\n- [Release notes](https://github.com/rspec/rspec/releases)\n- [Commits](https://github.com/rspec/rspec/compare/v3.8.0...v3.9.... | ruby | chosen |
[
{
"from": "system",
"value": "Fix design project serialization: add id\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nclass DesignProjectSerializer < ActiveModel::Serializer\n attributes :name, :created_at, :owner_email, :description\n\n has_many :analyses\n\n def owner_e... | ruby | chosen |
[
{
"from": "system",
"value": "Bump build version to 0.4.1\n"
},
{
"from": "human",
"value": "Gem::Specification.new do |s|\n s.name = \"fezzik\"\n s.version = \"0.4.0\"\n\n s.required_rubygems_version = Gem::Requirement.new(\">=0\") if s.respond_to? :required_rubygems_version=\n s.specificat... | ruby | chosen |
[
{
"from": "system",
"value": "Fix broken colors on Windows\n"
},
{
"from": "human",
"value": "module Cucumber\n class Broadcaster\n\n def initialize(receivers = [])\n @receivers = receivers\n end\n\n def register(receiver)\n @receivers << receiver\n end\n\n def method_m... | ruby | chosen |
[
{
"from": "system",
"value": "Add xib to pod resource.\n"
},
{
"from": "human",
"value": "Pod::Spec.new do |s|\n s.name = \"MLHudAlert\"\n s.version = \"0.0.1\"\n s.summary = \"Hud alert window for OS X\"\n s.homepage = \"https://github.com/MacLabs/MLHudAlert\"\n s.lic... | ruby | chosen |
[
{
"from": "system",
"value": "Add a Repository to Arrthorizer::Rails::ContextRole and add a .get_current() method\n"
},
{
"from": "human",
"value": "module Arrthorizer\n module Rails\n class ControllerAction\n ControllerNotDefined = Class.new(Arrthorizer::ArrthorizerException)\n Ac... | ruby | chosen |
[
{
"from": "system",
"value": "Fix overlapping in payer's name\n"
},
{
"from": "human",
"value": "class Bollettino::Renderer::PayerRenderer < Bollettino::Renderer\n def self.render(image, payer)\n render_name(image, payer)\n render_address(image, payer)\n end\n\n private\n\n def self.re... | ruby | chosen |
[
{
"from": "system",
"value": "Use variable already allocated for monitored_methods\n"
},
{
"from": "human",
"value": "require 'delegate'\n\nmodule Dry\n module System\n module Plugins\n module Monitoring\n # @api private\n class Proxy < SimpleDelegator\n # @api pr... | ruby | chosen |
[
{
"from": "system",
"value": "Revert \"Fix attempt for an integration project\"\n\nThis reverts commit 2a223655705526140f9a51215ece8dabe5fc2860.\n"
},
{
"from": "human",
"value": "module HstoreRadioButtons\n class ButtonOptions\n attr_accessor :name, :options\n def initialize(name, option... | ruby | chosen |
[
{
"from": "system",
"value": "Use strings for ZK java properties\n"
},
{
"from": "human",
"value": "require 'test_kafka/java_runner'\n\nmodule TestKafka\n class Zookeeper\n def initialize(kafka_path, tmp_dir, port)\n @port = port\n @jr = JavaRunner.new(\"zookeeper\",\n ... | ruby | chosen |
[
{
"from": "human",
"value": "Add gemfile as an install option\n\nResolves #13\n"
},
{
"from": "gpt",
"value": "Gem::Specification.new do |s|\n s.name = 'schema-evolution-manager'\n s.version = '0.0.0'\n s.date = Time.now.strftime('%Y-%m-%d')\n s.summary ... | ruby | chosen |
[
{
"from": "system",
"value": "Update documentation and change return value\n"
},
{
"from": "human",
"value": "class Module\n private\n\n # Works like attr_accessor but generates private methods for\n # class internal use only.\n def private_accessor(*names)\n names.each do |name|\n i... | ruby | chosen |
[
{
"from": "system",
"value": "Add specs for generate custom numbers with prefix and suffix options\n"
},
{
"from": "human",
"value": "require 'spec_helper'\n\ndescribe Uniqueness do\n context 'generate' do\n it { expect(Uniqueness.generate).not_to be_nil }\n end\nend\n"
},
{
"from":... | ruby | chosen |
[
{
"from": "human",
"value": "Test that url helpers use the correct domain\n"
},
{
"from": "gpt",
"value": "require 'rails_helper'\n\nRSpec.describe \"url helpers\", type: :helper do\n let(:headers) { helper.request.env }\n\n describe \"#admin_root_url\" do\n context \"when on the public web... | ruby | chosen |
[
{
"from": "system",
"value": "Fix improve how Hi gets found\n"
},
{
"from": "human",
"value": "module Lita\n module Handlers\n class Greet < Handler\n\n route(/^(hello|hi|good morning|howdy|yo!?$|hey) .*/i, :say_hello)\n route(/^welcome (.+)/i, :welcome)\n\n def say_hello(resp... | ruby | chosen |
[
{
"from": "system",
"value": "Change pagination to 10 on supplier\n"
},
{
"from": "human",
"value": "class DistributionPluginSupplierController < DistributionPluginMyprofileController\n no_design_blocks\n\n before_filter :set_admin_action, :only => [:index]\n before_filter :load_new, :only =>... | ruby | chosen |
[
{
"from": "system",
"value": "Move require statements to underneath the Spec::Rails module, so that the module exists before we try to use it.\n\n[#939 state:resolved milestone:'Next Release']\n"
},
{
"from": "human",
"value": "dir = File.dirname(__FILE__)\nrequire 'spec/rails/matchers/ar_be_val... | ruby | chosen |
[
{
"from": "system",
"value": "Add Middleware::Metrics to the default stack\n"
},
{
"from": "human",
"value": "Routes = Rack::Builder.new do\n use Pliny::Middleware::RequestStore::Clear, store: Pliny::RequestStore\n use Pliny::Middleware::CORS\n use Pliny::Middleware::RequestID\n use Pliny::M... | ruby | chosen |
[
{
"from": "system",
"value": "Make pandoc test case not fail when pandoc is not available\n"
},
{
"from": "human",
"value": "# encoding: utf-8\n\nclass Nanoc::Filters::PandocTest < MiniTest::Unit::TestCase\n\n include Nanoc::TestHelpers\n\n def test_filter\n if_have 'pandoc-ruby' do\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Correct syntax for making column NOT NULL\n"
},
{
"from": "human",
"value": "require \"securerandom\"\n\nclass AddApiKeyToPublicBodies < ActiveRecord::Migration\n def self.up\n add_column :public_bodies, :api_key, :string\n \n PublicBody.find_each do |pb|\... | ruby | chosen |
[
{
"from": "system",
"value": "Support a single redirection uri\n"
},
{
"from": "human",
"value": "require 'carto/db/migration_helper'\n\ninclude Carto::Db::MigrationHelper\n\nmigration(\n Proc.new do\n create_table :oauth_apps do\n Uuid :id, primary_key: true, default: 'uuid_gene... | ruby | chosen |
[
{
"from": "system",
"value": "Change migration field in comments migration from comment to content\n"
},
{
"from": "human",
"value": "class CreateComments < ActiveRecord::Migration\n def change\n create_table :comments do |t|\n t.text :comment\n\n t.integer :commentable_id\n t... | ruby | chosen |
[
{
"from": "system",
"value": "Add MIT license to gemspec\n"
},
{
"from": "human",
"value": "# roadie.gemspec\n# -*- encoding: utf-8 -*-\n\n$:.push File.expand_path(\"../lib\", __FILE__)\nrequire 'roadie/version'\n\nGem::Specification.new do |s|\n s.name = 'roadie'\n s.version = Road... | ruby | chosen |
[
{
"from": "system",
"value": "Allow all minor version upgrades of Paperclip 3.x\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'paperclip-optimizer/version'\n\nGem::Specification.new... | ruby | chosen |
[
{
"from": "system",
"value": "Move condition to method for improved readability.\n"
},
{
"from": "human",
"value": "class Experience < ActiveRecord::Base\n extend FriendlyId\n\n has_many :cocktails, dependent: :destroy\n accepts_nested_attributes_for :cocktails, reject_if: lambda { |cocktail|... | ruby | chosen |
[
{
"from": "system",
"value": "Use Accession::Permission regexp for validation\n\nThe code here predated what was available in accession\n"
},
{
"from": "human",
"value": "class Permission < ActiveRecord::Base\n audited comment_required: true, associated_with: :provider\n\n belongs_to :role\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Add test scenarios for displaying notebooks per user\n"
},
{
"from": "human",
"value": "require \"rails_helper\"\n\nRSpec.describe \"Creating a notebook\" do\n let(:user) { create(:user) }\n\n context \"signing in\" do\n before do\n sign_in_as user\n en... | ruby | chosen |
[
{
"from": "human",
"value": "Add explicit many_to_one integration spec for arel"
},
{
"from": "gpt",
"value": "require 'spec_helper_integration'\n\ndescribe '[Arel] Many To One with generated mapper' do\n include_context 'Models and Mappers'\n\n before(:all) do\n setup_db\n\n insert_user... | ruby | chosen |
[
{
"from": "system",
"value": "Update gemspec: add rspec and allow push\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'etcenv/version'\n\nGem::Specification.new do |spec|\n spec.nam... | ruby | chosen |
[
{
"from": "system",
"value": "Package version is increased from 1.2.2.0 to 2.2.2.0\n"
},
{
"from": "human",
"value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'evt-schema'\n s.summary = \"Primitives for schema and data structure\"\n s.version = '1.2.2.0'\n s.descri... | ruby | chosen |
[
{
"from": "system",
"value": "Fix description for GirFFI::VERSION test\n\nUnlike with classes, the bare constant does not result in the\ndescription being 'GirFFI::VERSION', but instead makes the description\nequal to the value of GirFFI::VERSION, which is not what we want.\n"
},
{
"from": "human",
... | ruby | chosen |
[
{
"from": "system",
"value": "Change JSON dump to JSON pretty_print\n"
},
{
"from": "human",
"value": "module LegalToMarkdown\n extend self\n\n def write_it( final_content, writer )\n final_content = final_content.gsub(/ +\\n/, \"\\n\") if writer == :markdown\n require 'json' if writer =... | ruby | chosen |
[
{
"from": "system",
"value": "Set march appropriately on RHEL5 32bit\n\nFix for issue 24."
},
{
"from": "human",
"value": "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the Licen... | ruby | chosen |
[
{
"from": "system",
"value": "Add additional test example to post mortem tests\n"
},
{
"from": "human",
"value": "require_relative 'test_helper'\n\ndescribe \"Post Mortem\" do\n include TestDsl\n\n it \"must enter into port mortem mode\" do\n enter 'cont'\n debug_file(\"post_mortem\") { ... | ruby | chosen |
[
{
"from": "system",
"value": "Test all the existing finders\n\nThe Finding Things Team is working towards moving some of the index\npages to finders. This commit will make it easier to continue adding new\nfinders and be sure they are tested and valid.\n"
},
{
"from": "human",
"value": "require ... | ruby | chosen |
[
{
"from": "system",
"value": "Drop white space in CSS class name for Alert"
},
{
"from": "human",
"value": "require 'capybara/bootstrap/base'\n\nmodule Capybara\n module Bootstrap\n class Alert < Base\n attr_reader :type\n\n class << self\n def all(type, options)\n ... | ruby | chosen |
[
{
"from": "system",
"value": "Create method set for saving attributes in model\n"
},
{
"from": "human",
"value": "# frozen_string_literal: true\n\nmodule RubyRabbitmqJanus\n module Models\n # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>\n #\n # Store instance information for Mong... | ruby | chosen |
[
{
"from": "system",
"value": "Include method for shortest string\n"
},
{
"from": "human",
"value": "# Shortest String\n\n# I worked on this challenge myself.\n\n# shortest_string is a method that takes an array of strings as its input\n# and returns the shortest string\n#\n# +list_of_words+ is a... | ruby | chosen |
[
{
"from": "system",
"value": "Remove fileutils (since isn't used explicitly).\n"
},
{
"from": "human",
"value": "require 'yaml'\nrequire 'pathname'\nrequire 'fileutils'\nrequire 'digest'\n\n# Gems.\nrequire 'active_support/ordered_hash'\nrequire 'rmagick'\n\n# On with the library...\nrequire 'mo... | ruby | chosen |
[
{
"from": "system",
"value": "Switch to warn so cap -T works\n"
},
{
"from": "human",
"value": "raise \"No staging server setup yet!\"\n# server \".us-west-2.compute.amazonaws.com\", :app, :db, :primary => true\n# set :branch, \"staging\"\n\n# namespace :deploy do\n# desc \"For the staging ... | ruby | chosen |
[
{
"from": "system",
"value": "Add custom validation to check number of tags\n"
},
{
"from": "human",
"value": "class Dojo < ApplicationRecord\n NUM_OF_COUNTRIES = \"70\"\n NUM_OF_WHOLE_DOJOS = \"1,200\"\n NUM_OF_JAPAN_DOJOS = \"70\"\n UPDATED_DATE = \"2017年1月\"\n\n serialize :tags\n... | ruby | chosen |
[
{
"from": "system",
"value": "Use activesupport gem, not active_support\n"
},
{
"from": "human",
"value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'virtus/representable/version'\n\nGem::Specification.new do |sp... | ruby | chosen |
[
{
"from": "system",
"value": "Update dependency for rails version.\n"
},
{
"from": "human",
"value": "$:.push File.expand_path(\"../lib\", __FILE__)\n\n# Maintain your gem's version:\nrequire \"ariadne_js_rails/version\"\n\n# Describe your gem and declare its dependencies:\nGem::Specification.ne... | ruby | chosen |
[
{
"from": "system",
"value": "Add alternative support for Sprockets and Opal\n"
},
{
"from": "human",
"value": "require 'ie/compat/version'\n\nmodule Ie\n module Compat\n IE_COMPAT_ASSETS_PATH = File.expand_path('../../../assets', __FILE__).freeze\n\n def ie_compat_assets_path\n IE_C... | ruby | chosen |
[
{
"from": "system",
"value": "Set the views directory explicitly.\n"
},
{
"from": "human",
"value": "require 'rubygems'\nrequire 'sinatra'\n\napp_root = File.expand_path(File.dirname(__FILE__) + '/..')\n\n$LOAD_PATH << app_root+'/vendor/Caged-lighthouse-api-1.0.0/lib'\n$LOAD_PATH << app_root+'/v... | ruby | chosen |
[
{
"from": "system",
"value": "Remove respond_to instruction causing an error\n"
},
{
"from": "human",
"value": "class APIController < ActionController::API\n include Operations::Performable\n\n respond_to :json\n\n rescue_from StandardError do |ex|\n handle_error(ex, :internal_server_error... | ruby | chosen |
[
{
"from": "system",
"value": "Remove newline (demo for Moazzam)"
},
{
"from": "human",
"value": "require 'mailman'\nrequire 'chronic'\n\nsettings_yaml = YAML.load_file(\"config.yml\")[\"production\"]\n\nMailman.config.rails_root = nil\nMailman.config.pop3 = { username: settings_yaml[\"gmail_emai... | ruby | chosen |
[
{
"from": "human",
"value": "Add processing attribute to issues.\n"
},
{
"from": "gpt",
"value": "class AddProcessingToIssues < ActiveRecord::Migration\n def self.up\n add_column :issues, :processing, :boolean, :default => true\n end\n\n def self.down\n remove_column :issues, :processin... | ruby | chosen |
[
{
"from": "system",
"value": "Add versioning logic to orders+option_types\n"
},
{
"from": "human",
"value": "class Spree::OrderVersion < ActiveRecord::Base\n belongs_to :order\n\n serialize :status, Hash\n\n validates :order, presence: true\n\n def self.make_version(order:)\n status = {\... | ruby | chosen |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.