conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Include support for tvos in podspec\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n\n s.name = 'SMAUpdatesAvailable'\n s.version = '1.0.1'\n s.summary = 'An easy to use library to check if there are iOS updates available for your appli...
ruby
chosen
[ { "from": "system", "value": "Refactor to make code clearer\n" }, { "from": "human", "value": "require 'multi_json'\n\nclass FinderSchema\n def initialize(schema_path)\n @schema_path = schema_path\n end\n\n def facets\n schema.fetch(\"facets\", []).map do |facet|\n facet.fetch(\"ke...
ruby
chosen
[ { "from": "system", "value": "server: Add tests for `anime_id` filter on `LibraryEntry` controller\n" }, { "from": "human", "value": "require 'rails_helper'\n\nRSpec.describe LibraryEntriesController, type: :controller do\n LIBRARY_ENTRY ||= { status: String, episodesWatched: Fixnum }\n let(:u...
ruby
chosen
[ { "from": "human", "value": "Add test to ensure no files miss magic encoding comment.\n" }, { "from": "gpt", "value": "describe \"Files missing magic encoding comment\" do\n subject(:files_missing_magic_encoding) {\n load File.expand_path('../../../bin/magic_encoding_find', __FILE__)\n ma...
ruby
chosen
[ { "from": "human", "value": "Bring simplified / cleaned up base controller into V1\n\n- Inherits from ActionController::API\n- Lots of superfluous junk removed\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nmodule Api\n module V1\n class BaseController < ActionController::...
ruby
chosen
[ { "from": "system", "value": "Fix bug in bulletins/busy for json\n" }, { "from": "human", "value": "class BulletinsController < ApplicationController\n expose(:longitude) do\n params[:longitude].try(:to_f) || request.location.longitude\n end\n\n expose(:latitude) do\n params[:latitude]....
ruby
chosen
[ { "from": "system", "value": "Add correct_user method as controller method and helper.\n" }, { "from": "human", "value": "class ApplicationController < ActionController::Base\n protect_from_forgery with: :exception\n before_action :configure_permitted_parameters, if: :devise_controller?\n bef...
ruby
chosen
[ { "from": "system", "value": "Fix missing end in productions controller\n" }, { "from": "human", "value": "class ProductionsController < ApplicationController\n\tdef index\n\tend\n\n\tdef new\n\t\t@production = Production.new(params)\n\t\tif @production.save\n\t\t\tredirect_to :new\n\t\telse\n\t...
ruby
chosen
[ { "from": "system", "value": "Fix show in order asc\n" }, { "from": "human", "value": "module Spree\n class Menu < ActiveRecord::Base\n\n scope :visible, lambda { where('visible = true and parent_id IS NULL').order('position DESC') }\n\n validates :name,:presentation,:url , :presence => t...
ruby
chosen
[ { "from": "system", "value": "Add age validator (between 0 and 110) and email format validator\n" }, { "from": "human", "value": "class Submission < ActiveRecord::Base\n validates :full_name, presence: true\n validates :age, presence: true\n validates :email, presence: true\n validates :code...
ruby
chosen
[ { "from": "system", "value": "Add source code URL to gemspec\n" }, { "from": "human", "value": "$:.push File.expand_path(\"../lib\", __FILE__)\nrequire \"postmark-rails/version\"\n\nGem::Specification.new do |s|\n s.name = %q{postmark-rails}\n s.version = PostmarkRails::VERSION\n s.authors = ...
ruby
chosen
[ { "from": "system", "value": "FIX : pour le seed\n" }, { "from": "human", "value": "module CommandesObserver\n extend ActiveSupport::Concern\n\n included do\n before_save :send_sms_on_etat_change\n end\n\nprivate\n def send_sms_on_etat_change\n if etat_changed?\n SMS.send to: user...
ruby
chosen
[ { "from": "system", "value": "Fix missing `require` for simple smart answers.\n" }, { "from": "human", "value": "class SimpleSmartAnswerEdition < Edition\n include Mongoid::Document\n\n field :nodes, type: Hash\n field :body, type: String\n\n GOVSPEAK_FIELDS = Edition::GOVSPEAK_FIELDS + [:bo...
ruby
chosen
[ { "from": "system", "value": "Embed categories and attributes implicitly within project\n\nSigned-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>\n" }, { "from": "human", "value": "json.extract! project, :id, :name, :short_description, :start_date, :end_date, :created...
ruby
chosen
[ { "from": "human", "value": "Add supporting specs for the Onfido configuration\n" }, { "from": "gpt", "value": "describe Onfido do\n subject(:onfido) { described_class }\n\n context 'configuration' do\n before do\n onfido.reset\n end\n\n {api_key: nil, endpoint: 'https://api.onfi...
ruby
chosen
[ { "from": "system", "value": "Add spec helpers for accessing directories in the project directory structure" }, { "from": "human", "value": "gem 'minitest'\nrequire 'yacl'\nrequire 'minitest/autorun'\nrequire 'minitest/pride'\nrequire 'tmpdir'\n\nmodule SpecHelpers\n def self.tmpfile_with_conte...
ruby
chosen
[ { "from": "system", "value": "Remove hash rocket in spec helper\n" }, { "from": "human", "value": "require \"codeclimate-test-reporter\"\nCodeClimate::TestReporter.start\n\n$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)\nrequire 'terraforming/dnsimple'\n\nrequire 'webmock/rspec'\nWeb...
ruby
chosen
[ { "from": "system", "value": "Add spec rails integration setup.\n" }, { "from": "human", "value": "require 'tytus'\n" }, { "from": "gpt", "value": "require 'tytus'\n\n# Configure Rails Envinronment\nENV[\"RAILS_ENV\"] = \"test\"\n\nrequire File.expand_path(\"../rails_app/config/envir...
ruby
chosen
[ { "from": "system", "value": "Make moderator display name depend on application\n\n * Set the `user_name` to display admin names based on app here rather than having to override in the apps themselves\n\n[Finished: #97469840]\n" }, { "from": "human", "value": "module SocialNetworking\n # A set ...
ruby
chosen
[ { "from": "system", "value": "Remove config for old-style assertions\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), \"..\", \"lib\"))\n$LOAD_PATH.unshift(File.dirname(__FILE__))\n\nrequire \"bundler\"\nBundler.require(:def...
ruby
chosen
[ { "from": "system", "value": "Enforce use of expect syntax" }, { "from": "human", "value": "# encoding: UTF-8\nrequire 'uglifier'\nrequire 'rspec'\nrequire 'source_map'\n\n# Requires supporting files with custom matchers and macros, etc,\n# in ./support/ and its subdirectories.\nDir[\"#{File.dir...
ruby
chosen
[ { "from": "system", "value": "Validate SKU of production (instead of the part)" }, { "from": "human", "value": "module SpreeFishbowl\n class SkuInFishbowlValidator < ActiveModel::EachValidator\n\n def validate_each(record, attribute, value)\n record.errors[attribute] << 'is not a valid ...
ruby
chosen
[ { "from": "system", "value": "Add c.stderr and some fixes\n" }, { "from": "human", "value": "require 'serverspec'\nrequire 'pathname'\n\nPROJECT_ROOT = (Pathname.new(File.dirname(__FILE__)) + '..').expand_path\n\nDir[PROJECT_ROOT.join(\"spec/support/**/*.rb\")].each { |file| require(file) }\n\nm...
ruby
chosen
[ { "from": "system", "value": "Update specs to require the file without the extension\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'devtools/spec_helper'\n\nif ENV['COVERAGE'] == 'true'\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatte...
ruby
chosen
[ { "from": "system", "value": "Update usage of the Code Climate Test Reporter\n" }, { "from": "human", "value": "require 'codeclimate-test-reporter'\nCodeClimate::TestReporter.start\nrequire 'simplecov'\nSimpleCov.start\n\n# ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)\n# r...
ruby
chosen
[ { "from": "system", "value": "Add broken test as a bookmark for next coding session\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe \"viewing my calendar\" do\n\n include Rack::Test::Methods\n\n def app\n CQalendaRS::Query::Server\n end\n\n describe \"GET /\" do\n ...
ruby
chosen
[ { "from": "system", "value": "Switch version to 0.0.3 for easier testing\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = \"NSObject-SafeExpectations\"\n s.version = \"0.1.0\"\n s.summary = \"No more crashes getting unexpected values from a NSDictionary.\"\...
ruby
chosen
[ { "from": "system", "value": "Create timed files now supports multiple new files.\n\n\ngit-svn-id: 6a2c20c72ceedae27ecedb68e90cd4f115192a7a@463 5af023f1-ac1a-0410-98d6-829a145c37ef\n" }, { "from": "human", "value": "#!/usr/bin/env ruby\n\nrequire 'ftools'\n\nmodule FileCreation\n OLDFILE = \"te...
ruby
chosen
[ { "from": "system", "value": "Change password to be more...secure :)\n" }, { "from": "human", "value": "default['phpapp']['home'] = '/home/www'\ndefault['phpapp']['user'] = 'www'\ndefault['phpapp']['group'] = 'www'\ndefault['phpapp']['git_repo_home'] = '/home/www/bhrsc'\n\ndefault['phpapp']['mys...
ruby
chosen
[ { "from": "system", "value": "Remove the default privacy setter - it's being taken care of by AR column defaults\n" }, { "from": "human", "value": "# == Schema Information\n#\n# Table name: groups\n#\n# id :integer not null, primary key\n# name :string(255) not null...
ruby
chosen
[ { "from": "system", "value": "Update calorie calculator, changed pace to be min/mile and distance to be in miles instead of meters\n" }, { "from": "human", "value": "class Trail < ActiveRecord::Base\n has_many :hikes\n\n def self.hike_time(dist, pace)\n # distance is in meters\n # pace i...
ruby
chosen
[ { "from": "system", "value": "Add tag to steps we've completed\n" }, { "from": "human", "value": "class Views::Steps::Index < Views::Base\n def content\n content_for :header_title, \"Navigation\"\n\n div class: \"slab\" do\n StepNavigation.sections.each do |section, steps|\n h...
ruby
chosen
[ { "from": "system", "value": "Expand spec for dry types with more examples\n" }, { "from": "human", "value": "RSpec.describe Dry::Validation::Schema, 'defining schema using dry types' do\n subject(:schema) do\n Dry::Validation.Schema do\n key(:email).required(Email)\n key(:age).may...
ruby
chosen
[ { "from": "system", "value": "Drop --source flag from update\n" }, { "from": "human", "value": "module Bummr\n class Updater\n def initialize(outdated_gems)\n @outdated_gems = outdated_gems\n end\n\n def update_gems\n puts \"Updating outdated gems\".green\n\n @outdated_g...
ruby
chosen
[ { "from": "system", "value": "Add a method to run the purge process in a continuous loop\n" }, { "from": "human", "value": "# models/purge_request.rb:\n# A queue of URLs to purge\n#\n# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.\n# Email: francis@mysociety.org; WWW: htt...
ruby
chosen
[ { "from": "system", "value": "Use an alternative suhosin patch for 5.3.18\n" }, { "from": "human", "value": "require File.join(File.dirname(__FILE__), 'abstract-php')\n\nclass Php53 < AbstractPhp\n init\n url 'http://www.php.net/get/php-5.3.18.tar.bz2/from/this/mirror'\n sha1 '561b7ed1ad14734...
ruby
chosen
[ { "from": "system", "value": "Add test for redirect to root if not logged in\n" }, { "from": "human", "value": "require 'rails_helper'\nrequire 'pry'\ndescribe EventsController do\n def stub_current_user user\n ApplicationController.any_instance.stub(:current_user) { user }\n end\n\n let(:...
ruby
chosen
[ { "from": "system", "value": "Use 'expect' syntax in specs\n" }, { "from": "human", "value": "require 'spec_helper'\n\nmodule Pact\n module Consumption\n describe Response do\n\n subject { Response.new({ woot: /x/, britney: 'britney', nested: { foo: /bar/, baz: 'qux' }, array: ['first',...
ruby
chosen
[ { "from": "system", "value": "Add a h0omepage to the gemspec" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'access_token_wrapper/version'\n\nGem::Specification.new do |spec|\n spec.n...
ruby
chosen
[ { "from": "system", "value": "Revert \"Remove attribute conditional reload\"\n\nThis reverts commit fdb1479a7cffde1fa8fe8324a0da86a982da007d.\n" }, { "from": "human", "value": "# Create or update maintenance configuration variable.\nservice \"nginx\" do\n action :nothing\n supports :start => t...
ruby
chosen
[ { "from": "system", "value": "Update gir_ffi and gir_ffi-gtk to 0.13.0\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nGem::Specification.new do |s|\n s.name = 'atspi_app_driver'\n s.version = '0.3.1'\n\n s.summary = 'Test GirFFI-based applications using Atspi'\n s.requir...
ruby
chosen
[ { "from": "system", "value": "Improve authenticate : check if current_account is present?\n" }, { "from": "human", "value": "module RefineryAuthenticationDeviseAuthorisationManagerDecorator\n\n # The user needs the 'refinery' role to access the admin.\n def authenticate!\n current_account =...
ruby
chosen
[ { "from": "human", "value": "Convert request spec to minitest\n" }, { "from": "gpt", "value": "# frozen_string_literal: true\n\nrequire \"test_helper\"\nrequire \"judoscale/request\"\nrequire \"judoscale/config\"\n\nmodule Judoscale\n describe Request do\n let(:request) { Request.new(env, co...
ruby
chosen
[ { "from": "system", "value": "Fix Podspec to iOS 8.0\n" }, { "from": "human", "value": "#\n# Be sure to run `pod lib lint RKParallaxEffect.podspec' to ensure this is a\n# valid spec and remove all comments before submitting the spec.\n#\n# Any lines starting with a # are optional, but encouraged...
ruby
chosen
[ { "from": "system", "value": "Swap the summary and description fields\n\nCurrently the gem's summary is long, and the description is short. This\nought to be the other way round.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire File.expand_path('../lib/axiom/types/version', __FILE...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.0.1.9 to 0.0.1.10\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'error_data'\n s.version = '0.0.1.9'\n s.summary = 'Representation of an error as a data structure'\n s.d...
ruby
chosen
[ { "from": "system", "value": "Package version is increased from 0.1.6 to 0.1.7\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nGem::Specification.new do |s|\n s.name = 'error_data'\n s.version = '0.1.6'\n s.summary = 'Representation of an error as a data structure'\n s.descript...
ruby
chosen
[ { "from": "system", "value": "Add link in Display Purchase Helper\n" }, { "from": "human", "value": "module InvoicesHelper\n def display_purchase(invoice)\n unless invoice.purchase.nil?\n invoice.purchase.description\n else\n \"(no Purchase set)\"\n end\n end\nend\n" }, ...
ruby
chosen
[ { "from": "system", "value": "Enable direct HTML editing in tiny MCE." }, { "from": "human", "value": "module TinyMceHelper\n\n def mce_init_string\n <<HEREDOC\ntinyMCE.init({\n theme : 'advanced',\n mode : 'textareas',\n plugins : \"paste, safari\",\n width : '100%',\n height...
ruby
chosen
[ { "from": "system", "value": "Fix errbit error - undefined method city for nil:NilClass\n" }, { "from": "human", "value": "class SecurityMailer < ApplicationMailer\n\tlayout nil\n\n def notify(user, type, activity)\n address = []\n Geocoder.configure(language: I18n.locale)\n ip_result ...
ruby
chosen
[ { "from": "system", "value": "Include workflow_id only for json format\n" }, { "from": "human", "value": "require 'forwardable'\nrequire 'json'\nrequire 'logger'\nrequire 'singleton'\n\nmodule Tumugi\n class Logger\n include Singleton\n extend Forwardable\n def_delegators :@logger, :de...
ruby
chosen
[ { "from": "system", "value": "Remove generated test in default serverspec\n" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe 'dev_box::default' do\n # Serverspec examples can be found at\n # http://serverspec.org/resource_types.html\n it 'does something' do\n skip 'Replac...
ruby
chosen
[ { "from": "system", "value": "Update podspec to reflect reorganization\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'Ornament'\n s.version = '0.1.0'\n s.summary = 'Ornament is a set of APIs used to provide visual ornamentation for iOS apps.'\n s.requir...
ruby
chosen
[ { "from": "system", "value": "Update version number to 1.1.1\n" }, { "from": "human", "value": "NAME = \"Date Input\"\nVERSION = \"1.1\"\nJQUERY = \"1.2\"\nPLUGINS = {\n \"Dimensions\" => \"http://plugins.jquery.com/files/dimensions_1.2.zip\"\n}\n" }, { "from": "gpt", "value": "NAME...
ruby
chosen
[ { "from": "system", "value": "Fix url generation for mailer\n" }, { "from": "human", "value": "module MailerHelper\n def delete_account_url_for(user)\n delete_confirmation_user_url host: organic_domain_for(user), token: user.delete_account_token\n end\n\n private\n\n def organic_domain_fo...
ruby
chosen
[ { "from": "system", "value": "Set content type to json\n" }, { "from": "human", "value": "require \"sinatra/base\"\nrequire \"json\"\n\nrequire_relative \"./logging.rb\"\nrequire_relative \"./error.rb\"\n\nrequire_relative \"./calculatorrouter.rb\"\nrequire_relative \"./calculatorloader.rb\"\n\n...
ruby
chosen
[ { "from": "system", "value": "Remove reference to old pull request file\n" }, { "from": "human", "value": "require \"circle_reaper/app\"\nrequire \"circle_reaper/circle_worker\"\nrequire \"circle_reaper/pull_request\"\n\nmodule CircleReaper\n def self.github_client\n @github_client ||= Githu...
ruby
chosen
[ { "from": "system", "value": "Add placeholder to employer name field\n" }, { "from": "human", "value": "class IncomePerMember < ManyMemberUpdateStep\n self.title = \"Money & Income\"\n self.subhead = \"Tell us more about your household's employment\"\n\n self.member_grouped_questions = {\n ...
ruby
chosen
[ { "from": "system", "value": "Fix bug in new_item search\n" }, { "from": "human", "value": "class NewsItem < ActiveRecord::Base\n extend Util::Pagination\n\n belongs_to :user\n before_validation :normalise_attributes\n\n validates_presence_of :user_id, :headline, :story\n validates_inclusi...
ruby
chosen
[ { "from": "system", "value": "Add validations to UserPage with method to update farthest page on creation of new entry.\n" }, { "from": "human", "value": "class UserPage < ActiveRecord::Base\n belongs_to :user\n belongs_to :page\nend\n" }, { "from": "gpt", "value": "class UserPage ...
ruby
chosen
[ { "from": "system", "value": "Update syntax to use new style.\n\nFor details of the change, see [here](https://devcenter.heroku.com/changelog-items/1058)." }, { "from": "human", "value": "module HerokuPgBackupsArchive\n module ToolbeltHelper\n RETRIES = 5\n\n class << self\n def capt...
ruby
chosen
[ { "from": "system", "value": "Improve the logging of both $stdout and $stderr; add a method to report HTTP stats.\n" }, { "from": "human", "value": "module Ld4lBrowserData\n module Utilities\n module ReportHelper\n def initialize(main_routine, path)\n @main_routine = main_routine...
ruby
chosen
[ { "from": "human", "value": "Add Hooloo class with utilities and such\n" }, { "from": "gpt", "value": "require 'uri'\nrequire 'open-uri'\nrequire 'multi_json'\n\nclass Hooloo\n class << self\n def auto_cast(obj)\n # TODO: Automatically cast an object received from Mozart into the corres...
ruby
chosen
[ { "from": "system", "value": "Add rspec to oauth2_server development\n" }, { "from": "human", "value": "# encoding: UTF-8\nrequire File.join(File.dirname(__FILE__), 'lib', 'social_stream', 'oauth2_server', 'version')\n\nGem::Specification.new do |s|\n s.name = \"social_stream-oauth2_server\"\n ...
ruby
chosen
[ { "from": "system", "value": "Add reference link for \"parametrized join\" in rails 4\n" }, { "from": "human", "value": "class AnswerController < ApplicationController\n protect_from_forgery with: :null_session\n skip_before_action :verify_authenticity_token\n\n def action_allowed?\n case ...
ruby
chosen
[ { "from": "system", "value": "Handle errors when sending payload\n" }, { "from": "human", "value": "require \"faraday\"\nrequire \"json\"\nrequire \"hashie\"\n\nrequire \"magnum/client/version\"\nrequire \"magnum/client/request\"\nrequire \"magnum/client/endpoints\"\n\nmodule Magnum\n class Cli...
ruby
chosen
[ { "from": "system", "value": "Fix deprecation warning on Thread connection close\n" }, { "from": "human", "value": "require \"net/http\"\nrequire \"uri\"\n\nmodule SocialStream \n module Ostatus\n module Models \n module Actor\n extend ActiveSupport::Concern\n\n include Ra...
ruby
chosen
[ { "from": "system", "value": "Return an understandable value when configuring chef\n\nThis was returning the amount of bytes written to solo.rb, which is\nnonsense for the client. Will eventaully add error handling to this.\n" }, { "from": "human", "value": "module Pantry\n module Chef\n\n c...
ruby
chosen
[ { "from": "system", "value": "Change `provided?` to provide validation, too\n\nAlthough `authorization_key` is not `nil`, its value might be. Because\nof this, a `params` split later on fails with a `NoMethodError`.\n" }, { "from": "human", "value": "require 'rack/request'\n\nmodule Rack\n modu...
ruby
chosen
[ { "from": "system", "value": "Raise exception if rails env is not set on autodiscover\n" }, { "from": "human", "value": "module PSQL\n class Database\n\n ##\n #\n def initialize( name )\n @name = case name\n when String\n name\n when :rails\n find_rails_dat...
ruby
chosen
[ { "from": "system", "value": "Rename allowed_transition validation to allowed_state\n" }, { "from": "human", "value": "require 'rails_machine/configuration'\n\nmodule RailsMachine\n extend ActiveSupport::Concern\n\n included do\n cattr_accessor :transitions\n\n validate :allowed_transiti...
ruby
chosen
[ { "from": "system", "value": "Remove useless code from the Runner class\n" }, { "from": "human", "value": "require 'pp'\nrequire 'yaml'\nrequire 'machete'\n\nmodule Scanny\n class Runner\n DEFAULT_CONFIG = File.join(File.dirname(__FILE__), \"..\", \"..\", \"scanny.yml\")\n\n attr_reader :...
ruby
chosen
[ { "from": "system", "value": "Fix violation of Style/CommentedKeyword cop\n" }, { "from": "human", "value": "require 'open3'\n\n# Simple wrapper around ClamAV\n#\n# This expects govuk_clamscan to exist on the PATH, and be a symlink\n# to either clamscan or clamdscan\nclass VirusScanner\n class ...
ruby
chosen
[ { "from": "system", "value": "Add test to ensure volunteer can't access other initiatives that the ones they run.\n" }, { "from": "human", "value": "require 'test_helper'\n\nclass InitiativesNewTest < ActionDispatch::IntegrationTest\n def setup\n @user = users(:admin)\n log_in_as(@user)\n...
ruby
chosen
[ { "from": "system", "value": "Add validation for student number\n" }, { "from": "human", "value": "class Opiskelija < ActiveRecord::Base\n belongs_to :aika\n\n validates :numero, uniqueness: {\n scope: :aika,\n message: \"Olet jo ilmoittautunut tähän aikaan.\"\n }, numericality: { only_...
ruby
chosen
[ { "from": "system", "value": "Make KernelStore no longer singleton\n" }, { "from": "human", "value": "require 'singleton'\nclass Configatron::KernelStore\n include ::Singleton\n\n attr_reader :store\n\n def initialize\n @store = ::Configatron::Store.new\n end\n\n def method_missing(name,...
ruby
chosen
[ { "from": "system", "value": "Add to_param to SimpleStep to fix StepNavigation\n" }, { "from": "human", "value": "class SimpleStep\n include ActiveModel::Model\n include ActiveModel::AttributeAssignment\n include ActiveModel::Validations::Callbacks\n\n # TODO: We should be using a path helpe...
ruby
chosen
[ { "from": "system", "value": "Set cap_git_tools dependency to ~> 0.9\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'capistrano-nvie-git-workflow/version'\n\nGem::Specifica...
ruby
chosen
[ { "from": "system", "value": "Update Blind Date overall categories\n" }, { "from": "human", "value": "class BlindDateAtTheDairyOverall < Overall\n def self.parent_event_name\n \"Blind Date at the Dairy\"\n end\n\n def category_names\n [\n \"Beginner Men\",\n \"Beginner Women\"...
ruby
chosen
[ { "from": "system", "value": "Add setter for style attribute to select tag\n" }, { "from": "human", "value": "module Inpost\n module HtmlHelper\n\n EDITABLE_ATTRIBUTES = %i(id class)\n\n class << self\n def machine_select_tag(collection: [], attributes: {})\n select_tag_templa...
ruby
chosen
[ { "from": "system", "value": "Install gems using 4 jobs to make things run faster\n" }, { "from": "human", "value": "copy_static_file 'Gemfile'\n\nin_root do\n gsub_file 'Gemfile', /RAILS_VERSION/, ::Pah::RAILS_VERSION\n\n # Since the gemset is likely empty, manually install bundler so it can ...
ruby
chosen
[ { "from": "system", "value": "Increase baseline speedtest min to 1.7s (slower on CI)\n" }, { "from": "human", "value": "# frozen_string_literal: true\nrequire_relative 'test_base'\n\nclass FeatureBaselineSpeedTest < TestBase\n\n def self.id58_prefix\n '159'\n end\n\n # - - - - - - - - - - ...
ruby
chosen
[ { "from": "human", "value": "Test special selector field numericality behavior\n" }, { "from": "gpt", "value": "require 'test_helper'\n\nclass SelectorFieldTest < ActiveSupport::TestCase\n test \"Selector fields should correctly detect numericality\" do\n numeric_field = FactoryGirl.create :...
ruby
chosen
[ { "from": "system", "value": "Allow a repository to be instantiated with given contents\n" }, { "from": "human", "value": "module Core::Repositories\n module Categories\n class Fake\n def all\n categories\n end\n\n def find(id)\n find_category(categories, id)\n ...
ruby
chosen
[ { "from": "system", "value": "Disable Launchy using ENV variable instead of completely redefining `deliver!` method.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nrequire 'letter_opener/delivery_method'\n\nmodule LetterOpenerWeb\n class DeliveryMethod < LetterOpener::Deliv...
ruby
chosen
[ { "from": "system", "value": "Tweak import rake task description\n\nCloses #394\n" }, { "from": "human", "value": "def glob_from_array(array)\n '{' + array.join(',') + '}'\nend\n\nnamespace :import do\n desc 'Import Organisations, Sites, Hosts and Hits'\n task :all => [\n 'import:all:orgs_...
ruby
chosen
[ { "from": "system", "value": "Add some docs to Tokenizer\n" }, { "from": "human", "value": "module Tokipona\n class Tokenizer\n def self.tokenize(text)\n new(text).tokenize\n end\n\n def initialize(text)\n @text = text\n @tokens = []\n @current_token = \"\"\n end...
ruby
chosen
[ { "from": "system", "value": "Add rubocop as development dependency\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'bundler/patch/version'\n\nGem::Specification.new do |spec|\n spec...
ruby
chosen
[ { "from": "system", "value": "Work around Logging laying claim to the constant and not ::Logging\n" }, { "from": "human", "value": "module Dldinternet\n module Mixlib\n module Logging\n # dldinternet-mixlib-logging version\n VERSION = \"0.4.0\"\n end\n end\nend\n" }, { ...
ruby
chosen
[ { "from": "system", "value": ":recycle: Use return for valid result and raise error for invalid result\n" }, { "from": "human", "value": "require 'magellan/gcs/proxy'\n\nmodule Magellan\n module Gcs\n module Proxy\n module ExpandVariable\n class InvalidReferenceError < StandardEr...
ruby
chosen
[ { "from": "system", "value": "Fix non-prerelease handling for gemspec\n" }, { "from": "human", "value": "# -*- encoding: utf-8 -*-\nrequire 'json'\n\npackage = JSON.parse(File.read('bower.json'))\n\nGem::Specification.new do |gem|\n gem.name = \"handlebars-source\"\n gem.authors ...
ruby
chosen
[ { "from": "system", "value": "Remove unused things from UserRefinery.\n" }, { "from": "human", "value": "class UserRefinery < Arcane::Refinery\n\n def update\n [:name,:username,:avatar,:password,:remote_avatar_url,:preferred_status]\n end\n\n def destroy\n [:password]\n end\n\nend" }...
ruby
chosen
[ { "from": "system", "value": "Use secure cookies in production\n" }, { "from": "human", "value": "# Be sure to restart your server when you modify this file.\n\nSlice::Application.config.session_store :cookie_store, key: '_slice_session'\n" }, { "from": "gpt", "value": "# Be sure to ...
ruby
chosen
[ { "from": "system", "value": "Replace key searching for queues with actual app queues\n" }, { "from": "human", "value": "module Sidekiq::LimitFetch::Global\n module Monitor\n extend self\n\n HEARTBEAT_PREFIX = 'heartbeat:'\n PROCESS_SET = 'processes'\n HEARTBEAT_TTL = 18\n REFRES...
ruby
chosen
[ { "from": "system", "value": "Add index to use drilldown\n" }, { "from": "human", "value": "class AddIndexToSearcherRecords < ActiveRecord::Migration\n def change\n reversible do |d|\n case\n when Redmine::Database.postgresql?\n opclass = \"pgroonga.varchar_full_text_search_...
ruby
chosen
[ { "from": "system", "value": "Rename rake task to message_broker:cartodb_subscribers\n" }, { "from": "human", "value": "namespace :poc do\n desc 'Consume messages from subscription \"central_cartodb_commands\"'\n task central_cartodb_commands: [:environment] do |_task, _args|\n include ::Lo...
ruby
chosen
[ { "from": "system", "value": "Revert \"Relax deps to compat with Rails 4.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 'brightbytes/sendgrid/version'\n\nGem::Specification.new d...
ruby
chosen
[ { "from": "system", "value": "Handle documents without SVG root elements\n" }, { "from": "human", "value": "module InlineSvg::TransformPipeline::Transformations\n class Width < Transformation\n def transform(doc)\n doc = Nokogiri::XML::Document.parse(doc.to_html)\n svg = doc.at_css...
ruby
chosen
[ { "from": "system", "value": "Configure 'Berlin' as default time zone" }, { "from": "human", "value": "require File.expand_path('../boot', __FILE__)\n\n# Pick the frameworks you want:\nrequire \"active_model/railtie\"\nrequire \"active_record/railtie\"\nrequire \"action_controller/railtie\"\nreq...
ruby
chosen
[ { "from": "system", "value": "Fix JSON type to allow rails to know when dirty" }, { "from": "human", "value": "module ActiveRecord\n module ConnectionAdapters\n module Sunstone\n module Type\n class Json < ActiveRecord::Type::Internal::AbstractJson\n\n def serialize(valu...
ruby
chosen