diff
stringlengths 65
26.7k
| message
stringlengths 7
9.92k
|
|---|---|
diff --git a/app/controllers/concerns/klasses_displayable.rb b/app/controllers/concerns/klasses_displayable.rb
index abc1234..def5678 100644
--- a/app/controllers/concerns/klasses_displayable.rb
+++ b/app/controllers/concerns/klasses_displayable.rb
@@ -14,6 +14,7 @@
def set_lectures
set_klass
- @lectures = @klass.lectures.includes(:lecturers, wday_periods: [:period])
+ @lectures =
+ @klass.lectures.current_term.includes(:lecturers, wday_periods: [:period])
end
end
|
Apply current_term scope to KlassesDisplayable
|
diff --git a/app/models/biblio_commons_title_content_item.rb b/app/models/biblio_commons_title_content_item.rb
index abc1234..def5678 100644
--- a/app/models/biblio_commons_title_content_item.rb
+++ b/app/models/biblio_commons_title_content_item.rb
@@ -35,7 +35,7 @@ end
def glyphicon
- case format
+ case self.format
when 'EBOOK' then 'ipad'
when 'DVD' then 'film'
when 'MUSIC_CD' then 'music'
|
Fix bug where attribute was mistaken for Kernel method.
|
diff --git a/app/validators/variable_duplicates_validator.rb b/app/validators/variable_duplicates_validator.rb
index abc1234..def5678 100644
--- a/app/validators/variable_duplicates_validator.rb
+++ b/app/validators/variable_duplicates_validator.rb
@@ -6,7 +6,7 @@ class VariableDuplicatesValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
if options[:scope]
- scoped = value.group_by { |variable| Array(options[:scope]).map { |attr| variable.send(attr) } }
+ scoped = value.group_by { |variable| Array(options[:scope]).map { |attr| variable.send(attr) } } # rubocop:disable GitlabSecurity/PublicSend
scoped.each_value { |scope| validate_duplicates(record, attribute, scope) }
else
validate_duplicates(record, attribute, value)
|
Disable public send cop in variables duplicates validator
|
diff --git a/spec/functions/cidr_to_range_spec.rb b/spec/functions/cidr_to_range_spec.rb
index abc1234..def5678 100644
--- a/spec/functions/cidr_to_range_spec.rb
+++ b/spec/functions/cidr_to_range_spec.rb
@@ -1,7 +1,7 @@ require 'spec_helper'
describe 'cidr_to_range' do
- cidr = '192.168.1.0/29'
+ let (:cidr) { '192.168.1.0/29' }
it 'should return the range ips excluding the network and broadcast addresses' do
ips = [
@@ -31,4 +31,12 @@ it 'should fail if given insane data type' do
expect { subject.call([ [] ]) }.to raise_error(Puppet::ParseError)
end
+
+ context "with a /32 cidr" do
+ let (:cidr) { '192.168.1.0/32' }
+
+ it 'should return an empty list' do
+ should run.with_params(cidr).and_return([])
+ end
+ end
end
|
Add test case for a /32 cidr.
This should return an empty set.
|
diff --git a/spec/informant-rails/railtie_spec.rb b/spec/informant-rails/railtie_spec.rb
index abc1234..def5678 100644
--- a/spec/informant-rails/railtie_spec.rb
+++ b/spec/informant-rails/railtie_spec.rb
@@ -26,12 +26,12 @@ end
context '#valid?' do
- let(:save_action) { :save }
+ let(:save_action) { :valid? }
it_should_behave_like 'save action'
end
context '#invalid?' do
- let(:save_action) { :save }
+ let(:save_action) { :invalid? }
it_should_behave_like 'save action'
end
end
|
Fix save actions in railtie spec
|
diff --git a/spec/lib/udongo/configs/i18n_spec.rb b/spec/lib/udongo/configs/i18n_spec.rb
index abc1234..def5678 100644
--- a/spec/lib/udongo/configs/i18n_spec.rb
+++ b/spec/lib/udongo/configs/i18n_spec.rb
@@ -0,0 +1,21 @@+require 'rails_helper'
+
+describe Udongo::Configs::I18n do
+ let(:klass) { described_class }
+
+ describe 'defaults' do
+ it :default_locale do
+ expect(klass.new.default_locale).to eq 'nl'
+ end
+
+ it :locales do
+ expect(klass.new.locales).to eq %w(nl en fr de)
+ end
+ end
+
+ it '#respond_to?' do
+ expect(klass.new).to respond_to(
+ :default_locale, :default_locale=, :locales, :locales=
+ )
+ end
+end
|
Add spec for the i18n config.
|
diff --git a/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb b/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb
index abc1234..def5678 100644
--- a/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb
+++ b/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb
@@ -3,6 +3,10 @@ class PaypalExpressResponse < Response
def email
@params['payer']
+ end
+
+ def full_name
+ [@params['first_name'], @params['middle_name'], @params['last_name']].compact.join(' ')
end
def token
@@ -11,6 +15,10 @@
def payer_id
@params['payer_id']
+ end
+
+ def payer_country
+ @params['payer_country']
end
def address
|
Access to more PaypalExpressResponse variables
git-svn-id: 15afb6ebb5ffcaa0dbaaa80925839866918ea29e@329 6513ea26-6c20-0410-8a68-89cd7235086d
|
diff --git a/TZImagePickerController.podspec b/TZImagePickerController.podspec
index abc1234..def5678 100644
--- a/TZImagePickerController.podspec
+++ b/TZImagePickerController.podspec
@@ -11,5 +11,5 @@ s.requires_arc = true
s.resources = "TZImagePickerController/TZImagePickerController/*.{png,bundle}"
s.source_files = "TZImagePickerController/TZImagePickerController/*.{h,m}"
- s.frameworks = "Photos", "MobileCoreServices"
+ s.frameworks = "Photos"
end
|
Fix warning: MobileCoreServices has been renamed
|
diff --git a/src/supermarket/spec/api/status_spec.rb b/src/supermarket/spec/api/status_spec.rb
index abc1234..def5678 100644
--- a/src/supermarket/spec/api/status_spec.rb
+++ b/src/supermarket/spec/api/status_spec.rb
@@ -2,13 +2,13 @@
describe 'GET /status' do
it 'returns a 200' do
- get 'status'
+ get '/status'
expect(response.status.to_i).to eql(200)
end
it 'returns a status ok' do
- get 'status'
+ get '/status'
expect(json_body).to include('status' => 'ok')
end
|
Include a slash in the request specs for the status endpoint.
Signed-off-by: Robb Kidd <11cd4f9ba93acb67080ee4dad8d03929f9e64bf2@chef.io>
|
diff --git a/coverband.gemspec b/coverband.gemspec
index abc1234..def5678 100644
--- a/coverband.gemspec
+++ b/coverband.gemspec
@@ -20,7 +20,7 @@
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
- spec.add_development_dependency "mocha"
+ spec.add_development_dependency "mocha", "~> 0.14.0"
spec.add_development_dependency "shoulda"
spec.add_development_dependency "rack"
spec.add_runtime_dependency "simplecov"
|
Add optimistic Mocha version constraint of 0.14.x.
|
diff --git a/spec/adminable/presenters/entry_spec.rb b/spec/adminable/presenters/entry_spec.rb
index abc1234..def5678 100644
--- a/spec/adminable/presenters/entry_spec.rb
+++ b/spec/adminable/presenters/entry_spec.rb
@@ -0,0 +1,10 @@+describe Adminable::Presenters::Entry do
+ let(:user) { FactoryGirl.create(:user) }
+ let(:entry) { Adminable::Presenters::Entry.new(user) }
+
+ describe '#to_name' do
+ it 'returns name for entry' do
+ expect(entry.to_name).to eq(user.email)
+ end
+ end
+end
|
Add specs for entry presenter
|
diff --git a/spec/integration/veritas/relation/operation/insertion/optimize_spec.rb b/spec/integration/veritas/relation/operation/insertion/optimize_spec.rb
index abc1234..def5678 100644
--- a/spec/integration/veritas/relation/operation/insertion/optimize_spec.rb
+++ b/spec/integration/veritas/relation/operation/insertion/optimize_spec.rb
@@ -30,6 +30,7 @@ subject
end
+ # check to make sure the right rename is factored out
its(:operand) { should eql(original_left.insert(original_right)) }
it_should_behave_like 'an optimize method'
|
Add comment to spec to make sure it's clear what the right rename should be
* This example checks to make sure that the UnoptimizedOperands optimizer is
running properly and simplified the right branch by factoring out the rename
operation (since it is a rename, then an inverted rename, each cancelling the
other out).
|
diff --git a/benchmarks/speed_profile.rb b/benchmarks/speed_profile.rb
index abc1234..def5678 100644
--- a/benchmarks/speed_profile.rb
+++ b/benchmarks/speed_profile.rb
@@ -0,0 +1,26 @@+require 'benchmark/ips'
+require 'verse'
+
+text = "Ignorance is the parent of fear."
+
+Benchmark.ips do |x|
+ x.report('wrap') do
+ Verse::Wrapping.wrap(text, 10)
+ end
+
+ x.report('truncate') do
+ Verse::Truncation.truncate(text, 10)
+ end
+
+ x.compare!
+end
+
+# Warming up --------------------------------------
+# wrap 178.000 i/100ms
+# truncate 262.000 i/100ms
+# Calculating -------------------------------------
+# wrap 1.812k (± 1.9%) i/s - 9.078k in 5.010776s
+# truncate 2.625k (± 1.9%) i/s - 13.362k in 5.092305s
+# Comparison:
+# truncate: 2624.9 i/s
+# wrap: 1812.3 i/s - 1.45x slower
|
Add benchmarks to profile wrap & truncate speeds.
|
diff --git a/Library/Mestral/mestral/repository.rb b/Library/Mestral/mestral/repository.rb
index abc1234..def5678 100644
--- a/Library/Mestral/mestral/repository.rb
+++ b/Library/Mestral/mestral/repository.rb
@@ -21,7 +21,7 @@ def initialize(path)
@path = File.expand_path path
Dir.chdir @path do
- @git_dir = File.join @path, `git rev-parse --git-dir`.strip
+ @git_dir = `git rev-parse --git-dir`.strip
end
end
|
Fix GIT_DIR detection in Repository
|
diff --git a/cardboard.gemspec b/cardboard.gemspec
index abc1234..def5678 100644
--- a/cardboard.gemspec
+++ b/cardboard.gemspec
@@ -6,6 +6,7 @@ gem.description = "Development tools for Boxen's puppet modules."
gem.summary = "Development dependencies for the ecosystem."
gem.homepage = "https://github.com/boxen/cardboard"
+ gem.license = "MIT"
gem.executables = ["cardboard", "cardboardify"]
gem.files = `git ls-files`.split $/
|
Add license to gemspec, is MIT
|
diff --git a/test/integration/events_test.rb b/test/integration/events_test.rb
index abc1234..def5678 100644
--- a/test/integration/events_test.rb
+++ b/test/integration/events_test.rb
@@ -3,19 +3,21 @@ # :stopdoc:
class EventsTest < ActionController::IntegrationTest
def test_index
- FactoryGirl.create(:event)
- FactoryGirl.create(:event)
+ Timecop.freeze(Time.zone.local(2013, 3)) do
+ FactoryGirl.create(:event)
+ FactoryGirl.create(:event)
- get "/events"
- assert_redirected_to schedule_path
+ get "/events"
+ assert_redirected_to schedule_path
- get "/events.xml"
- assert_response :success
- xml = Hash.from_xml(@response.body)
- assert_not_nil xml["single_day_events"], "Should have :single_day_events root element in #{xml}"
+ get "/events.xml"
+ assert_response :success
+ xml = Hash.from_xml(response.body)
+ assert_not_nil xml["single_day_events"], "Should have :single_day_events root element in #{xml}"
- get "/events.json"
- assert_response :success
- assert_equal 2, JSON.parse(@response.body).size, "Should have JSON array"
+ get "/events.json"
+ assert_response :success
+ assert_equal 2, JSON.parse(response.body).size, "Should have JSON array"
+ end
end
end
|
Fix year boundary test failure
|
diff --git a/spec/controllers/cards_controller_spec.rb b/spec/controllers/cards_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/cards_controller_spec.rb
+++ b/spec/controllers/cards_controller_spec.rb
@@ -2,4 +2,24 @@
RSpec.describe CardsController, type: :controller do
+ descripe 'POST create' do
+ describe 'If all the necessary params are included and valid' do
+ xit 'Creates a new card' do
+
+ end
+
+ xit 'Reloads the page with the flag to enable checkout' do
+
+ end
+
+ describe 'If there are problems with the parmams' do
+ xit 'Rerenders the page with an error' do
+
+ end
+
+ xit 'Autofills the fields with the existing input' do
+
+ end
+ end
+ end
end
|
Add pending tests for cards controller
|
diff --git a/spec/controllers/hosts_controller_spec.rb b/spec/controllers/hosts_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/hosts_controller_spec.rb
+++ b/spec/controllers/hosts_controller_spec.rb
@@ -2,7 +2,7 @@
describe HostsController do
describe '#index' do
- let(:site) { create :site, :with_default_host }
+ let(:site) { create :site }
before do
get :index
|
Remove last with_default_host trait usage
This trait was removed in 200e6db, but this instance was missed.
|
diff --git a/app/contexts/merge_requests_load_context.rb b/app/contexts/merge_requests_load_context.rb
index abc1234..def5678 100644
--- a/app/contexts/merge_requests_load_context.rb
+++ b/app/contexts/merge_requests_load_context.rb
@@ -9,7 +9,7 @@ merge_requests = case type
when 'all' then merge_requests
when 'closed' then merge_requests.closed
- when 'assigned-to-me' then merge_requests.opened.assigned(current_user)
+ when 'assigned-to-me' then merge_requests.opened.assigned_to(current_user)
else merge_requests.opened
end
|
Fix missing assigned_to renaming in 2e839ce
fixes #4360.
|
diff --git a/app/controllers/email_signups_controller.rb b/app/controllers/email_signups_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/email_signups_controller.rb
+++ b/app/controllers/email_signups_controller.rb
@@ -3,6 +3,15 @@
def new
return error_404 unless subtopic.present?
+
+ set_slimmer_dummy_artefact(
+ section_name: subtopic.title,
+ section_link: subcategory_path(sector: subtopic.parent_slug, subcategory: subtopic.child_slug),
+ parent: {
+ section_name: subtopic.parent_sector_title,
+ section_link: "/#{subtopic.parent_slug}",
+ }
+ )
end
def create
|
Add breadcrumps to the email signup page
This uses the dummy artefact pattern to add breadcrumbs to the email
subscription page for a sub-topic, linking back to the topic and
sub-topic, so that users can find their way back to the sub-topic if
they do not wish to subscribe to email alerts.
|
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -4,7 +4,12 @@ def create
@organization = Organization.new organization_params.merge(admin_id: current_user.id)
if @organization.save
- render json: OrganizationRepresenter.new(@organization).to_json
+ render json: OrganizationRepresenter.new(@organization).to_json(
+ user_options: {
+ current_user_is_member: true,
+ current_user_is_admin: true,
+ }
+ )
else
render json: @organization.errors, status: :unprocessable_entity
end
|
Fix the representer for the new org page
|
diff --git a/app/inputs/unscoped_has_many_token_input.rb b/app/inputs/unscoped_has_many_token_input.rb
index abc1234..def5678 100644
--- a/app/inputs/unscoped_has_many_token_input.rb
+++ b/app/inputs/unscoped_has_many_token_input.rb
@@ -0,0 +1,15 @@+class UnscopedHasManyTokenInput < Formtastic::Inputs::StringInput
+
+ def input_html_options
+ search_property = options[:search_property] || "name"
+ super.merge(
+ "class" => "active-admin-tokeninput",
+ "data-field-name" => "#{object_name.try(:underscore)}[#{method.to_s.singularize}_ids][]",
+ # Removed the data-pre field, because if you are using a custom form it will not respond to the method
+ "name" => "",
+ "value" => "",
+ "data-autocomplete-path" => options[:autocomplete_path] ||= Rails.application.routes.url_helpers.send("autocomplete_admin_#{method.to_s}_path"),
+ "data-property-to-search" => search_property
+ )
+ end
+end
|
Allow unscoped has many for custom forms
|
diff --git a/color-decomposition.gemspec b/color-decomposition.gemspec
index abc1234..def5678 100644
--- a/color-decomposition.gemspec
+++ b/color-decomposition.gemspec
@@ -14,8 +14,10 @@ spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test)/})
end
+ spec.required_ruby_version = '~> 2.4'
spec.require_paths = ['lib']
spec.add_development_dependency 'bundler', '~> 1.13'
+ spec.add_development_dependency 'test-unit', '~> 3.1'
spec.add_development_dependency 'rake', '~> 12.0'
spec.add_dependency 'rmagick', '~> 2.16'
end
|
Add ruby required ruby version and test dependency
|
diff --git a/app/models/user.rb b/app/models/user.rb
index abc1234..def5678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -31,9 +31,21 @@
has_many :shippers, through: :order
+ after_create :set_account_number, if: "account_number.blank?"
# NOTE: Others available Devise modules:
# :confirmable, :lockable, :timeoutable, :omniauthable, :recoverable, :rememberable, :trackable
devise :database_authenticatable, :registerable, :validatable
+ private
+
+ # NOTE: run after User.create
+ def generate_account_number
+ "FI-%.6d" % id
+ end
+
+ def set_account_number
+ update!(account_number: generate_account_number)
+ end
+
end
|
Add methods to generate and set account number on signup
|
diff --git a/config/deploy/production.rb b/config/deploy/production.rb
index abc1234..def5678 100644
--- a/config/deploy/production.rb
+++ b/config/deploy/production.rb
@@ -1,6 +1,7 @@ set :stage, :production
-set :user, 'root'
+set :user, 'deployer'
+set :use_sudo, false
role :app, '162.243.221.218'
role :web, '162.243.221.218'
|
Deploy with deployer user not root.
|
diff --git a/13_optimal_seating.rb b/13_optimal_seating.rb
index abc1234..def5678 100644
--- a/13_optimal_seating.rb
+++ b/13_optimal_seating.rb
@@ -0,0 +1,64 @@+class PeopleMatrix
+ def initialize(pairs)
+ @matrix = Hash.new { |h, k| h[k] = Hash.new(0) }
+
+ pairs.each { |p1, p2, happiness|
+ @matrix[p1][p2] += happiness
+ @matrix[p2][p1] += happiness
+ }
+ end
+
+ def best(circular: true)
+ circular ? best_cycle : best_line
+ end
+
+ def score(seating, circular: true)
+ circular ? score_cycle(seating) : score_line(seating)
+ end
+
+ private
+
+ def best_cycle
+ people = @matrix.keys
+ first_person = people.shift
+ # Total happiness is invariant to rotation.
+ # So we eliminate rotations by fixing the first person.
+ people.permutation.max_by { |seating|
+ seating << first_person
+ score_cycle(seating)
+ }
+ end
+
+ def score_cycle(seating)
+ seating.each_with_index.sum { |p1, i|
+ p2 = seating[i - 1]
+ @matrix[p1][p2]
+ }
+ end
+
+ def best_line
+ @matrix.keys.permutation.max_by { |seating| score_line(seating) }
+ end
+
+ def score_line(seating)
+ seating.each_cons(2).sum { |p1, p2| @matrix[p1][p2] }
+ end
+end
+
+LINE = /^(.+) would (gain|lose) (\d+) happiness units by sitting next to (.+)\.$/
+
+verbose = ARGV.delete('-v')
+
+people = PeopleMatrix.new(ARGF.each_line.map { |line|
+ p1, polarity, happiness, p2 = LINE.match(line).captures
+ happiness = Integer(happiness)
+ happiness *= -1 if polarity == 'lose'
+ [p1, p2, happiness]
+})
+
+# Inserting "me" into the table with 0 score == a non-circular table.
+[true, false].each { |circular|
+ best = people.best(circular: circular)
+ puts people.score(best, circular: circular)
+ puts best.join(', ') if verbose
+}
|
Add day 13: Optimal Seating
|
diff --git a/api/config/initializers/doorkeeper.rb b/api/config/initializers/doorkeeper.rb
index abc1234..def5678 100644
--- a/api/config/initializers/doorkeeper.rb
+++ b/api/config/initializers/doorkeeper.rb
@@ -10,6 +10,10 @@ user if user&.valid_for_authentication? { user.valid_password?(params[:password]) }
end
+ admin_authenticator do |routes|
+ current_spree_user&.has_spree_role?('admin') || redirect_to(routes.root_url)
+ end
+
use_refresh_token
grant_flows %w(password)
|
Allow only users with role admin to access Oauth applications management panel
|
diff --git a/cask/dropdmg.rb b/cask/dropdmg.rb
index abc1234..def5678 100644
--- a/cask/dropdmg.rb
+++ b/cask/dropdmg.rb
@@ -1,9 +1,9 @@ cask :v1 => 'dropdmg' do
- version '3.2.6'
+ version '3.2.7'
app 'DropDMG.app'
- sha256 '8e07cdeef08db9f32f150c76e3145ca1b8ed131f9d8132d739ee90126da9a88e'
+ sha256 '5f27c67364cef6569633b98e250f73119016249ec7ec06908c117a008dc6c55f'
- url 'https://c-command.com/downloads/DropDMG-3.2.6.dmg'
+ url 'https://c-command.com/downloads/DropDMG-3.2.7.dmg'
name 'DropDMG'
homepage 'https://c-command.com/dropdmg/'
|
Update DropDMG cask for 3.2.7
|
diff --git a/app/controllers/manuals_controller.rb b/app/controllers/manuals_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/manuals_controller.rb
+++ b/app/controllers/manuals_controller.rb
@@ -1,21 +1,13 @@ class ManualsController < ApplicationController
- def index
- manual = ManualsRepository.new.fetch(params["manual_id"])
+ before_filter :set_manual
- error_not_found unless manual
- @manual = ManualPresenter.new(manual)
-
- end
+ def index; end
def show
- manual = ManualsRepository.new.fetch(params["manual_id"])
document = ManualsRepository.new.fetch(params["manual_id"], params["section_id"])
-
- error_not_found unless manual && document
- @manual = ManualPresenter.new(manual)
+ error_not_found unless document
@document = DocumentPresenter.new(document, @manual)
-
end
private
@@ -24,4 +16,9 @@ render status: :not_found, text: "404 error not found"
end
+ def set_manual
+ manual = ManualsRepository.new.fetch(params["manual_id"])
+ error_not_found unless manual
+ @manual = ManualPresenter.new(manual)
+ end
end
|
Refactor Manual fetching to before_filter
|
diff --git a/app/controllers/resumes_controller.rb b/app/controllers/resumes_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/resumes_controller.rb
+++ b/app/controllers/resumes_controller.rb
@@ -18,11 +18,10 @@ format.json
format.md
format.pdf do
- render :pdf => @resume.name,
- :layout => 'resume.pdf.erb',
- :template => 'resumes/show.html.erb',
- :disable_smart_shrinking => true,
- :page_size => 'Letter'
+ render pdf: @resume.name,
+ layout: 'resume.pdf.erb',
+ template: 'resumes/show.html.erb',
+ page_size: 'Letter'
end
end
end
|
Use new dict style in WickedPdf arguments
Signed-off-by: Max Fierke <0706025b2bbcec1ed8d64822f4eccd96314938d0@maxfierke.com>
|
diff --git a/app/helpers/bootstrap_form_builder.rb b/app/helpers/bootstrap_form_builder.rb
index abc1234..def5678 100644
--- a/app/helpers/bootstrap_form_builder.rb
+++ b/app/helpers/bootstrap_form_builder.rb
@@ -0,0 +1,30 @@+# Helper para la construccion de formularios conformes
+# al estilo de bootstrap
+class BootstrapFormBuilder < ActionView::Helpers::FormBuilder
+
+ def text_field(method, options={})
+ t = @template
+ t.content_tag(:div, :class => "control-group#{' error' unless @object.errors[method].blank?}") {
+ t.concat(t.label_tag method, nil, :class => "control-label")
+ t.concat(t.content_tag(:div, :class => "controls") {
+ t.concat(super method, options)
+ if @object.errors[method].present?
+ t.concat(t.content_tag(:span, @object.errors[method].last, :class => 'help-inline'))
+ end
+ })
+ }
+ end
+
+ def password_field(method, options={})
+ t = @template
+ t.content_tag(:div, :class => "control-group#{' error' unless @object.errors[method].blank?}") {
+ t.concat(t.label_tag method, nil, :class => "control-label")
+ t.concat(t.content_tag(:div, :class => "controls") {
+ t.concat(super method, options)
+ if @object.errors[method].present?
+ t.concat(t.content_tag(:span, @object.errors[method].last, :class => 'help-inline'))
+ end
+ })
+ }
+ end
+end
|
Add custom form builder for bootstrap
|
diff --git a/app/models/activity_classification.rb b/app/models/activity_classification.rb
index abc1234..def5678 100644
--- a/app/models/activity_classification.rb
+++ b/app/models/activity_classification.rb
@@ -9,7 +9,7 @@
def self.diagnostic
- ActivityClassification.find_by_name "diagnostic"
+ ActivityClassification.find_by_key "diagnostic"
end
end
|
Stop looking for Diagnostic by name
|
diff --git a/app/models/socializer/notification.rb b/app/models/socializer/notification.rb
index abc1234..def5678 100644
--- a/app/models/socializer/notification.rb
+++ b/app/models/socializer/notification.rb
@@ -10,7 +10,7 @@ belongs_to :activity_object # Person, Group, ...
# Validations
- validates_presence_of :activity_id
- validates_presence_of :activity_object_id
+ validates :activity_id, presence: true
+ validates :activity_object_id, presence: true
end
end
|
Use the new "sexy" validations (validates ...)
|
diff --git a/app/serializers/comment_serializer.rb b/app/serializers/comment_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/comment_serializer.rb
+++ b/app/serializers/comment_serializer.rb
@@ -6,7 +6,7 @@
has_one :author, serializer: UserSerializer, root: 'users'
has_one :discussion, serializer: DiscussionSerializer
- has_one :parent, serializer: CommentSerializer, root: 'comments'
+ #has_one :parent, serializer: CommentSerializer, root: 'comments'
has_many :likers, serializer: UserSerializer, root: 'users'
has_many :attachments, serializer: AttachmentSerializer, root: 'attachments'
|
Remove parent from comment serializer
|
diff --git a/spec/features/databases_spec.rb b/spec/features/databases_spec.rb
index abc1234..def5678 100644
--- a/spec/features/databases_spec.rb
+++ b/spec/features/databases_spec.rb
@@ -0,0 +1,30 @@+require "spec_helper"
+
+describe "using the databases api" do
+ include_context "netrc"
+
+ context "to create" do
+ When { VCR.use_cassette('databases/create') { run "rumm create database on dbinstance decided-irony --name dancing-bear" }}
+ Then { all_stdout =~ /Created database/ }
+ And { last_exit_status.should eql 0 }
+ end
+
+ context "to show" do
+ When { VCR.use_cassette('databases/show') { run "rumm show database dancing-bear on dbinstance decided-irony" }}
+ Then { all_stdout =~ /dancing-bear/ }
+ And { last_exit_status.should eql 0 }
+ end
+
+ context "to show all" do
+ Given { pending "Not working, some sort of error in forms" }
+ When { VCR.use_cassette('databases/show-all') { run "rumm show databases on dbinstance decided-irony" }}
+ Then { all_stdout =~ /Databases/}
+ And { last_exit_status.should eql 0 }
+ end
+
+ context "to destroy" do
+ When { VCR.use_cassette('databases/destroy') { run "rumm destroy database dancing-bear on dbinstance decided-irony" }}
+ Then { all_stdout =~ /Detached volume/}
+ And { last_exit_status.should eql 0 }
+ end
+end
|
Set up tests for databases
|
diff --git a/spec/plugin/capture_erb_spec.rb b/spec/plugin/capture_erb_spec.rb
index abc1234..def5678 100644
--- a/spec/plugin/capture_erb_spec.rb
+++ b/spec/plugin/capture_erb_spec.rb
@@ -22,6 +22,9 @@ r.get 'inject' do
render(:inline => "<% some_method do %>foo<% end %>")
end
+ r.get 'outside' do
+ capture_erb{1}
+ end
end
def some_method(&block)
@@ -43,5 +46,9 @@ it "should work with the inject_erb plugin" do
body('/inject').strip.must_equal "barFOObaz"
end
+
+ it "should return result of block converted to string when used outside template" do
+ body('/outside').must_equal "1"
+ end
end
end
|
Add spec for using capture_erb outside template
|
diff --git a/test/functional/quotes_controller_test.rb b/test/functional/quotes_controller_test.rb
index abc1234..def5678 100644
--- a/test/functional/quotes_controller_test.rb
+++ b/test/functional/quotes_controller_test.rb
@@ -3,6 +3,7 @@ class QuotesControllerTest < ActionController::TestCase
setup do
@quote = quotes(:one)
+ @quote_attributes = @quote.attributes.slice(:raw_quote, :description)
end
test "should get index" do
@@ -18,7 +19,7 @@
test "should create quote" do
assert_difference('Quote.count') do
- post :create, quote: @quote.attributes
+ post :create, quote: @quote_attributes
end
assert_redirected_to quote_path(assigns(:quote))
@@ -35,7 +36,7 @@ end
test "should update quote" do
- put :update, id: @quote, quote: @quote.attributes
+ put :update, id: @quote, quote: @quote_attributes
assert_redirected_to quote_path(assigns(:quote))
end
|
Fix quote controller test for mass-assignment protection
|
diff --git a/test/unit/country_select_question_test.rb b/test/unit/country_select_question_test.rb
index abc1234..def5678 100644
--- a/test/unit/country_select_question_test.rb
+++ b/test/unit/country_select_question_test.rb
@@ -17,8 +17,8 @@ end
test "Can convert key to pretty name" do
- assert_equal(@question.to_response(7), {slug: "antigua-and-barbuda", name: "Antigua and Barbuda"})
- assert_equal(@question.to_response(20), {slug: "belgium", name: "Belgium"})
+ assert_equal(@question.to_response("antigua-and-barbuda"), {slug: "antigua-and-barbuda", name: "Antigua and Barbuda"})
+ assert_equal(@question.to_response("belgium"), {slug: "belgium", name: "Belgium"})
end
end
-end+end
|
Fix country_select unit test to work with updated to_response
|
diff --git a/cookbooks/ad-auth/attributes/ad_settings.rb b/cookbooks/ad-auth/attributes/ad_settings.rb
index abc1234..def5678 100644
--- a/cookbooks/ad-auth/attributes/ad_settings.rb
+++ b/cookbooks/ad-auth/attributes/ad_settings.rb
@@ -1,3 +1,2 @@-#default[:authorization] = {}
-#default[:authorization][:ad_likewise] = {}
+#The AD network we will be joining. This is used to pull the appropriate authorization databag item
default[:authorization][:ad_auth][:ad_network] = ""
|
Add more information to the attributes file and remove old ad-likewise
entries
Former-commit-id: 73686a66aa4fd9749d0a260ab6851f294bd48d20
|
diff --git a/core/spec/screenshots/non_signed_in_spec.rb b/core/spec/screenshots/non_signed_in_spec.rb
index abc1234..def5678 100644
--- a/core/spec/screenshots/non_signed_in_spec.rb
+++ b/core/spec/screenshots/non_signed_in_spec.rb
@@ -12,7 +12,7 @@
sign_out_user
visit user_profile_path(@user)
-
+ sleep 5
assume_unchanged_screenshot "non_signed_in_profile"
end
end
|
Fix spec initially with a sleep
|
diff --git a/with_model.gemspec b/with_model.gemspec
index abc1234..def5678 100644
--- a/with_model.gemspec
+++ b/with_model.gemspec
@@ -11,6 +11,7 @@ s.homepage = "https://github.com/Casecommons/with_model"
s.summary = %q{Dynamically build a model within an RSpec context}
s.description = s.summary
+ s.licenses = ["MIT"]
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
Add MIT license to gemspec
|
diff --git a/db/seeds/development/fake_students.seeds.rb b/db/seeds/development/fake_students.seeds.rb
index abc1234..def5678 100644
--- a/db/seeds/development/fake_students.seeds.rb
+++ b/db/seeds/development/fake_students.seeds.rb
@@ -0,0 +1,43 @@+Assessment.destroy_all
+School.destroy_all
+assessment = Assessment.create(name: "MCAS", year: Time.new(2014))
+healey = School.create(name: "Arthur D Healey")
+
+Room.destroy_all
+n = 0
+4.times do |n|
+ Room.create(name: "10#{n}")
+ n += 1
+end
+
+Student.destroy_all
+StudentResult.destroy_all
+
+FIRST_NAMES = [ "Casey", "Josh", "Judith", "Tae", "Kenn" ]
+LAST_NAMES = [ "Jones", "Pais", "Hoag", "Pak", "Scott" ]
+
+36.times do |s|
+ student = Student.create(
+ grade: "5",
+ hispanic_latino: [true, false].sample,
+ race: ["A", "B", "H", "W"].sample,
+ low_income: [true, false].sample,
+ room_id: Room.all.sample.id,
+ first_name: FIRST_NAMES.sample,
+ last_name: LAST_NAMES.sample,
+ state_identifier: "000#{rand(1000)}",
+ limited_english_proficient: [true, false].sample,
+ former_limited_english_proficient: [true, false].sample,
+ school_id: healey.id
+ )
+ result = StudentResult.create(
+ student_id: student.id,
+ assessment_id: assessment.id,
+ ela_scaled: rand(200..280),
+ ela_performance: ["W", "NI", "P", "A"].sample,
+ ela_growth: rand(10..20),
+ math_scaled: rand(200..280),
+ math_performance: ["W", "NI", "P", "A"].sample,
+ math_growth: rand(10..20)
+ )
+end
|
Add seed task for creating fake student data.
+ #35.
|
diff --git a/app/controllers/likes_controller.rb b/app/controllers/likes_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/likes_controller.rb
+++ b/app/controllers/likes_controller.rb
@@ -0,0 +1,13 @@+class LikesController < ApplicationController
+ before_action :authenticate_user!
+
+ def index
+ @likes = current_user.likes
+
+ render json: {
+ data: {
+ likes: @likes
+ }
+ }, status: 200
+ end
+end
|
Add likes controller and index for current user
|
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -1,5 +1,5 @@ class PagesController < ApplicationController
- before_action :authenticate_user!, except: :index
+ before_action :authenticate_user!, except: [:index, :help]
def index
@latest_battles = Battle.order("updated_at desc").includes(:arena).limit 5
end
|
Allow unlogged in users to view help
|
diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/wikis_controller.rb
+++ b/app/controllers/wikis_controller.rb
@@ -24,14 +24,17 @@ @wiki = Wiki.find(params[:id])
old_name = @wiki.name
@wiki.name = params[:wiki][:name]
- @wiki.save
+ if @wiki.save
+ old_path = Rails.root.join('wikis', old_name)
+ new_path = Rails.root.join('wikis', @wiki.name)
- old_path = Rails.root.join('wikis', old_name)
- new_path = Rails.root.join('wikis', @wiki.name)
+ `mv "#{old_path}" "#{new_path}"`
- `mv "#{old_path}" "#{new_path}"`
-
- redirect_to root_url and return
+ redirect_to root_url and return
+ else
+ flash[:error] = "Could not rename wiki."
+ render :edit
+ end
end
def destroy
|
Add validation to update method
|
diff --git a/Casks/phpstorm-eap.rb b/Casks/phpstorm-eap.rb
index abc1234..def5678 100644
--- a/Casks/phpstorm-eap.rb
+++ b/Casks/phpstorm-eap.rb
@@ -1,6 +1,6 @@ cask :v1 => 'phpstorm-eap' do
- version '141.2017'
- sha256 'f0ec9828aab591159531cdeb815dcf976d9707bb126a84daa4554809c9fc34b2'
+ version '141.2325'
+ sha256 'd9fb715b9c6a351bd30f25e62aa1f6fae2938b17065999efd1375e5a3f4fedba'
url "https://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg"
name 'PhpStorm EAP'
|
Update PhpStorm EAP.app to latest version
|
diff --git a/Casks/phpstorm-eap.rb b/Casks/phpstorm-eap.rb
index abc1234..def5678 100644
--- a/Casks/phpstorm-eap.rb
+++ b/Casks/phpstorm-eap.rb
@@ -1,6 +1,6 @@ cask :v1 => 'phpstorm-eap' do
- version '141.891'
- sha256 '5fca9d16de932905109decc442889f1534b5e77b5226ff15c77bd8259aa88ec0'
+ version '141.1306'
+ sha256 'ebd04e0378cb2d5c528bb9e7618dbb89ddb1d9e7f9e429cd21594e622194a7e2'
url "http://download.jetbrains.com/webide/PhpStorm-EAP-#{version}.dmg"
homepage 'http://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Early+Access+Program'
|
Update PHPStorm EAP to 141.1306
|
diff --git a/Casks/smart-scroll.rb b/Casks/smart-scroll.rb
index abc1234..def5678 100644
--- a/Casks/smart-scroll.rb
+++ b/Casks/smart-scroll.rb
@@ -1,6 +1,6 @@ cask 'smart-scroll' do
- version '4.0.6'
- sha256 '18582a39a6cfb08ab9f2ff99852eb245055d506d70b5573bf59be62e4c5c6078'
+ version '4.0.7'
+ sha256 '825517a2078bda2477be58cf36a6293d157b8e1057a4f615bcc6ce8d08aafcd4'
url 'http://www.marcmoini.com/SmartScroll.zip'
name 'Smart Scroll'
|
Update Smart Scroll to v4.0.7
|
diff --git a/app/serializers/clump_serializer.rb b/app/serializers/clump_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/clump_serializer.rb
+++ b/app/serializers/clump_serializer.rb
@@ -15,7 +15,7 @@
def links
object.clump_links.select(&:complete?).map do |link|
- ClumpLinkSerializer.new(link, scope_name: :locale)
+ ClumpLinkSerializer.new(link, scope: scope)
end
end
end
|
Fix bug in defining ClumpLinkSerializer scope
|
diff --git a/app/concerns/resources_controller/location_history.rb b/app/concerns/resources_controller/location_history.rb
index abc1234..def5678 100644
--- a/app/concerns/resources_controller/location_history.rb
+++ b/app/concerns/resources_controller/location_history.rb
@@ -17,6 +17,7 @@ def store_location
return if request.referer.nil?
truncate_location_history(9)
+ puts "[LocationHistoryConcern] Storing last location [#{request.referer}]"
location_history[Time.zone.now] = request.referer
end
|
Add log output to location history.
|
diff --git a/spec/views/scientific_names/show.html.haml_spec.rb b/spec/views/scientific_names/show.html.haml_spec.rb
index abc1234..def5678 100644
--- a/spec/views/scientific_names/show.html.haml_spec.rb
+++ b/spec/views/scientific_names/show.html.haml_spec.rb
@@ -28,6 +28,18 @@ render
# Run the generator again with the --webrat flag if you want to use webrat matchers
rendered.should match(/Zea mays/)
- rendered.should match(@scientific_name.id.to_s)
+ end
+
+ context 'signed in' do
+
+ before :each do
+ @wrangler = FactoryGirl.create(:crop_wrangling_member)
+ sign_in @wrangler
+ render
+ end
+
+ it 'should have an edit button' do
+ rendered.should have_content 'Edit'
+ end
end
end
|
Update the expectations: an edit link is visible to crop wranglers (which used to be an expectation about the id appearing in a link)
|
diff --git a/db/migrate/20161104135655_add_epix_user_fields_to_annual_report_upload.rb b/db/migrate/20161104135655_add_epix_user_fields_to_annual_report_upload.rb
index abc1234..def5678 100644
--- a/db/migrate/20161104135655_add_epix_user_fields_to_annual_report_upload.rb
+++ b/db/migrate/20161104135655_add_epix_user_fields_to_annual_report_upload.rb
@@ -1,9 +1,9 @@ class AddEpixUserFieldsToAnnualReportUpload < ActiveRecord::Migration
def change
add_column :trade_annual_report_uploads, :epix_created_by_id, :integer
- add_column :trade_annual_report_uploads, :epix_created_at, :integer
+ add_column :trade_annual_report_uploads, :epix_created_at, :datetime
add_column :trade_annual_report_uploads, :epix_updated_by_id, :integer
- add_column :trade_annual_report_uploads, :epix_updated_at, :integer
+ add_column :trade_annual_report_uploads, :epix_updated_at, :datetime
remove_column :trade_annual_report_uploads, :is_from_epix
end
end
|
Change created_at and updated_at to datetime type
|
diff --git a/lib/administrate/field/select.rb b/lib/administrate/field/select.rb
index abc1234..def5678 100644
--- a/lib/administrate/field/select.rb
+++ b/lib/administrate/field/select.rb
@@ -3,7 +3,10 @@
module Administrate
module Field
- class Select < Base
+ class Select < Base
+ class Engine < ::Rails::Engine
+ end
+
def choices
options.fetch(:choices, []).
map { |o| prettify? ? [prettify(o), o] : o }
|
Add an engine to make sure views are installed
|
diff --git a/test/models/cf0925_test.rb b/test/models/cf0925_test.rb
index abc1234..def5678 100644
--- a/test/models/cf0925_test.rb
+++ b/test/models/cf0925_test.rb
@@ -1,10 +1,10 @@ require 'test_helper'
class Cf0925Test < ActiveSupport::TestCase
- # test "the truth" do
- # assert true
- # end
test 'generation of a PDF' do
+ unless ENV['TEST_PDF_GENERATION']
+ skip 'Skipping PDF generation. To include: `export TEST_PDF_GENERATION=1`'
+ end
rtp = cf0925s(:one)
assert rtp.generate_pdf
assert File.exist?(rtp.pdf_file), "File #{rtp.pdf_file} not found"
|
Check environment to exclude PDF generation test.
|
diff --git a/config/schedule.rb b/config/schedule.rb
index abc1234..def5678 100644
--- a/config/schedule.rb
+++ b/config/schedule.rb
@@ -3,6 +3,6 @@ # We need Rake to use our own environment
job_type :rake, "cd :path && /usr/local/bin/govuk_setenv tariff-api bundle exec rake :task --silent :output"
-every :day, :at => '01:23am' do
+every 1.hour do
rake "tariff:sync:apply"
end
|
Revert "Only run tariff sync once a day at 01:23"
This reverts commit b21cac649e2907a53784fb0f15fdf8ae08441552.
|
diff --git a/XLTestLog.podspec b/XLTestLog.podspec
index abc1234..def5678 100644
--- a/XLTestLog.podspec
+++ b/XLTestLog.podspec
@@ -12,7 +12,8 @@ s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
- s.frameworks = 'Foundation', 'XCTest'
+ s.frameworks = 'Foundation'
+ s.weak_framework = 'XCTest'
s.source_files = 'XLTestLog/*.{h,m}'
|
Update XCTest to weak framework
|
diff --git a/cookbooks/travis_internal_base/spec/ssh_spec.rb b/cookbooks/travis_internal_base/spec/ssh_spec.rb
index abc1234..def5678 100644
--- a/cookbooks/travis_internal_base/spec/ssh_spec.rb
+++ b/cookbooks/travis_internal_base/spec/ssh_spec.rb
@@ -8,12 +8,7 @@
EXPECTED_SSHD_CONFIG = <<~EOF.split("\n")
addressfamily any
- authorizedkeysfile .ssh/authorized_keys .ssh/authorized_keys2
- challengeresponseauthentication no
- ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
- clientalivecountmax 3
clientaliveinterval 0
- hostkeyalgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
ignorerhosts yes
ignoreuserknownhosts no
kerberosauthentication no
|
Remove the rest of the things with '-'
|
diff --git a/test/helpers/user_helper_test.rb b/test/helpers/user_helper_test.rb
index abc1234..def5678 100644
--- a/test/helpers/user_helper_test.rb
+++ b/test/helpers/user_helper_test.rb
@@ -5,7 +5,6 @@ #
class UserHelperTest < ActionView::TestCase
include Devise::TestHelpers
- include UserHelper
test 'should return true if user is super_administrator' do
@super_administrator = users(:anthony)
|
Remove unnecessary import of helper
|
diff --git a/composition.gemspec b/composition.gemspec
index abc1234..def5678 100644
--- a/composition.gemspec
+++ b/composition.gemspec
@@ -9,7 +9,6 @@ s.summary = %q{Helper for object composition}
s.description = s.summary
- # git ls-files
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {spec}/*`.split("\n")
s.executables = []
|
Remove unneded comment in gemspec
|
diff --git a/send_with_us.gemspec b/send_with_us.gemspec
index abc1234..def5678 100644
--- a/send_with_us.gemspec
+++ b/send_with_us.gemspec
@@ -12,6 +12,7 @@ gem.description = %q{SendWithUs.com Ruby Client}
gem.summary = %q{SendWithUs.com Ruby Client}
gem.homepage = "https://github.com/sendwithus/sendwithus_ruby"
+ gem.license = "Apache-2.0"
gem.files = `git ls-files`.split($/)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
Add license to gemspec, is Apache-2.0
per http://spdx.org/licenses/
Closes #7
|
diff --git a/app/helpers/statistics_helper.rb b/app/helpers/statistics_helper.rb
index abc1234..def5678 100644
--- a/app/helpers/statistics_helper.rb
+++ b/app/helpers/statistics_helper.rb
@@ -44,6 +44,9 @@ series: {
connectNulls: true
}
+ },
+ legend: {
+ enabled: true
}
}
}
|
Add the filterable legend back in
|
diff --git a/transam_accounting.gemspec b/transam_accounting.gemspec
index abc1234..def5678 100644
--- a/transam_accounting.gemspec
+++ b/transam_accounting.gemspec
@@ -18,7 +18,7 @@
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
- s.add_dependency 'rails', '>=4.0.9'
+ s.add_dependency 'rails', '~> 4.1.9'
s.add_development_dependency "rspec-rails"
s.add_development_dependency "factory_girl_rails"
|
Make the rails version in the gemspec more restrictive
|
diff --git a/test/unit/asset_remover_test.rb b/test/unit/asset_remover_test.rb
index abc1234..def5678 100644
--- a/test/unit/asset_remover_test.rb
+++ b/test/unit/asset_remover_test.rb
@@ -2,7 +2,7 @@
class AssetRemoverTest < ActiveSupport::TestCase
setup do
- @logo_dir = File.join(Whitehall.clean_uploads_root, 'system', 'uploads', 'organisation', 'logo')
+ @logo_dir = File.join(Whitehall.clean_uploads_root, 'system', 'uploads', 'topical_event', 'logo')
@logo_path = File.join(@logo_dir, '960x640_jpeg.jpg')
fixture_asset_path = Rails.root.join('test', 'fixtures', 'images', '960x640_jpeg.jpg')
@@ -16,24 +16,24 @@ FileUtils.remove_dir(@logo_dir, true)
end
- test '#remove_organisation_logo removes all logos' do
+ test '#remove_topical_event_logo removes all logos' do
assert File.exist?(@logo_path)
- @subject.remove_organisation_logo
+ @subject.remove_topical_event_logo
refute File.exist?(@logo_path)
end
- test '#remove_organisation_logo removes the containing directory' do
+ test '#remove_topical_event_logo removes the containing directory' do
assert Dir.exist?(@logo_dir)
- @subject.remove_organisation_logo
+ @subject.remove_topical_event_logo
refute Dir.exist?(@logo_dir)
end
- test '#remove_organisation_logo returns an array of the files remaining after removal' do
- files = @subject.remove_organisation_logo
+ test '#remove_topical_event_logo returns an array of the files remaining after removal' do
+ files = @subject.remove_topical_event_logo
assert_equal [], files
end
|
Change AssetRemoverTest to use one of the new methods
I want to delete some of the tasks that have already been run
including `AssetRemover#remove_organisation_logo`. Changing the tests
to use one of methods I won't remove will let me do that.
|
diff --git a/test/unit/attendee_slot_test.rb b/test/unit/attendee_slot_test.rb
index abc1234..def5678 100644
--- a/test/unit/attendee_slot_test.rb
+++ b/test/unit/attendee_slot_test.rb
@@ -1,6 +1,13 @@ require 'test_helper'
class AttendeeSlotTest < ActiveSupport::TestCase
+ def test_fields
+ slot = AttendeeSlot.new(:max => 3, :min => 1, :preferred => 2)
+ assert_equal 1, slot.min
+ assert_equal 3, slot.max
+ assert_equal 2, slot.preferred
+ end
+
def test_nil_defaults_to_zero
slot = AttendeeSlot.new(:max => nil, :min => nil, :preferred => nil)
assert_equal 0, slot.min
|
Add a sanity check to make sure the override methods aren't screwing up normal behavior
|
diff --git a/lib/cultome_player/plugins/keyboard_special_keys.rb b/lib/cultome_player/plugins/keyboard_special_keys.rb
index abc1234..def5678 100644
--- a/lib/cultome_player/plugins/keyboard_special_keys.rb
+++ b/lib/cultome_player/plugins/keyboard_special_keys.rb
@@ -4,15 +4,16 @@ def init_plugin_keyboard_special_keys
Thread.new do
start_cmd = "tail -f #{command_pipe}"
- pipe = IO.popen(start_cmd, "rw")
- pipe.each do |line|
- #IO.popen(start_cmd).each do |line|
- # planchamos el prompt...
- display_over("")
- # ejecutamos el comando
- execute_interactively line
- # y luego lo regeneramos
- display_over c5(CultomePlayer::Interactive::PROMPT)
+ IO.popen(start_cmd, "r+") do |pipe|
+ begin
+ line = pipe.gets
+ # planchamos el prompt...
+ display_over("")
+ # ejecutamos el comando
+ execute_interactively line
+ # y luego lo regeneramos
+ display_over c5(CultomePlayer::Interactive::PROMPT)
+ end while true
end # IO
end # Thread
end
|
Change the way the command pipe read the commands
|
diff --git a/lib/services/chef_project/chef_project_generator.rb b/lib/services/chef_project/chef_project_generator.rb
index abc1234..def5678 100644
--- a/lib/services/chef_project/chef_project_generator.rb
+++ b/lib/services/chef_project/chef_project_generator.rb
@@ -21,7 +21,9 @@ private
def create_project_folder
- FileUtils.mkdir_p project_path
+ %w(nodes roles).each do |dir|
+ FileUtils.mkdir_p project_path.join(dir)
+ end
end
def copy_base_files
|
:panda_face: Create nodes and roles during init chef project..
|
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index abc1234..def5678 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -17,6 +17,8 @@ config.order = :random
config.render_views
config.include FactoryGirl::Syntax::Methods
+ config.filter_run :focus
+ config.run_all_when_everything_filtered = true
FactoryGirl::SyntaxRunner.send(:include, RSpec::Mocks::ExampleMethods)
end
|
chore(): Add focus support on rspec
|
diff --git a/db/dev_seeds/sdg.rb b/db/dev_seeds/sdg.rb
index abc1234..def5678 100644
--- a/db/dev_seeds/sdg.rb
+++ b/db/dev_seeds/sdg.rb
@@ -18,4 +18,15 @@ end
end
end
+
+ relatables = [Debate, Proposal, Poll, Legislation::Process, Budget::Investment]
+ relatables.map { |relatable| relatable.sample(5) }.flatten.each do |relatable|
+ Array(SDG::Goal.sample(rand(1..3))).each do |goal|
+ target = goal.targets.sample
+ local_target = target.local_targets.sample
+ relatable.sdg_goals << goal
+ relatable.sdg_targets << target
+ relatable.sdg_local_targets << local_target if local_target.present?
+ end
+ end
end
|
Add SDG relations to development seeds
|
diff --git a/lib/fog/aws/requests/storage/get_service.rb b/lib/fog/aws/requests/storage/get_service.rb
index abc1234..def5678 100644
--- a/lib/fog/aws/requests/storage/get_service.rb
+++ b/lib/fog/aws/requests/storage/get_service.rb
@@ -15,13 +15,13 @@ # * DisplayName [String] - Display name of bucket owner
# * ID [String] - Id of bucket owner
#
- # @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTServiceGET.html
+ # @see https://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html
#
def get_service
request({
:expects => 200,
:headers => {},
- :host => @host,
+ :host => 's3.amazonaws.com',
:idempotent => true,
:method => 'GET',
:parser => Fog::Parsers::AWS::Storage::GetService.new
|
Set correct host for get service operation
|
diff --git a/lib/omniauth/strategies/wordpress_hosted.rb b/lib/omniauth/strategies/wordpress_hosted.rb
index abc1234..def5678 100644
--- a/lib/omniauth/strategies/wordpress_hosted.rb
+++ b/lib/omniauth/strategies/wordpress_hosted.rb
@@ -8,7 +8,7 @@
# This is where you pass the options you would pass when
# initializing your consumer from the OAuth gem.
- option :client_options, { token_url: "/oauth/token", authorize_url: "/oauth/authorize" }
+ option :client_options, { token_url: "/oauth/token", authorize_url: "/oauth/authorize", me_url: "/oauth/me" }
# These are called after authentication has succeeded. If
@@ -32,7 +32,7 @@ end
def raw_info
- @raw_info ||= access_token.get("#{options[:client_options][:site]}/me").parsed
+ @raw_info ||= access_token.get(options[:client_options][:me_url]).parsed
end
end
end
|
Update endpoints used by WP OAuth Server 3.1.3
|
diff --git a/lib/sastrawi/dictionary/array_dictionary.rb b/lib/sastrawi/dictionary/array_dictionary.rb
index abc1234..def5678 100644
--- a/lib/sastrawi/dictionary/array_dictionary.rb
+++ b/lib/sastrawi/dictionary/array_dictionary.rb
@@ -9,13 +9,22 @@ add_words(words)
end
+ ##
+ # Check whether a word is contained in the dictionary
+
def contains?(word)
@words.include?(word)
end
+ ##
+ # Count how many words in the dictionary
+
def count
@words.length
end
+
+ ##
+ # Add multiple words to the dictionary
def add_words(new_words)
new_words.each do |word|
@@ -23,11 +32,17 @@ end
end
+ ##
+ # Add a word to the dictionary
+
def add(word)
return if word == ''
@words.push(word)
end
+
+ ##
+ # Add words from a text file to the dictionary
def add_words_from_text_file(file_path)
words = []
@@ -41,6 +56,9 @@ add_words(words)
end
+ ##
+ # Remove a word from the dictionary
+
def remove(word)
@words.delete(word)
end
|
Add comments to `ArrayDictionary` class
|
diff --git a/doc/lib/template.rb b/doc/lib/template.rb
index abc1234..def5678 100644
--- a/doc/lib/template.rb
+++ b/doc/lib/template.rb
@@ -14,6 +14,7 @@ end
end
+ # (Map String String) -> Binding
MakeBinding = lambda do |ctxt|
Namespace.new(ctxt).get_binding
end
|
Add type declaration for MakeBinding
|
diff --git a/GestureRecognizerClosures.podspec b/GestureRecognizerClosures.podspec
index abc1234..def5678 100644
--- a/GestureRecognizerClosures.podspec
+++ b/GestureRecognizerClosures.podspec
@@ -6,7 +6,7 @@ s.homepage = "https://github.com/marcbaldwin/GestureRecognizerClosures"
s.author = { "Marc Baldwin" => "marc.baldwin88@gmail.com" }
s.source = { :git => "https://github.com/marcbaldwin/GestureRecognizerClosures.git", :tag => s.version }
- s.source_files = "GestureRecognizerClosures"
+ s.source_files = "GestureRecognizerClosures/*.swift"
s.platform = :ios, '8.0'
s.frameworks = "Foundation", "UIKit"
s.requires_arc = true
|
Update podspec sources to include all swift files
|
diff --git a/lib/generators/historyjs/install/install_generator.rb b/lib/generators/historyjs/install/install_generator.rb
index abc1234..def5678 100644
--- a/lib/generators/historyjs/install/install_generator.rb
+++ b/lib/generators/historyjs/install/install_generator.rb
@@ -20,4 +20,4 @@ end
end
end
-end if ::Rails.version < "3.1"
+end if ::Rails.version < "3.1" || !::Rails.application.config.assets.enabled
|
Allow people to bring their own asset management solutions to the party
|
diff --git a/app/admin/reps.rb b/app/admin/reps.rb
index abc1234..def5678 100644
--- a/app/admin/reps.rb
+++ b/app/admin/reps.rb
@@ -2,6 +2,8 @@ scope :all
scope :unassigned
+ permit_params :user_id, :party_id
+
index do
column :id
column :user_name
|
Fix issue with admin interface when assigning a rep to a party
|
diff --git a/Casks/silicon-labs-vcp-driver.rb b/Casks/silicon-labs-vcp-driver.rb
index abc1234..def5678 100644
--- a/Casks/silicon-labs-vcp-driver.rb
+++ b/Casks/silicon-labs-vcp-driver.rb
@@ -2,14 +2,14 @@ version :latest
sha256 :no_check
- url 'http://www.silabs.com/Support%20Documents/Software/Mac_OSX_VCP_Driver.zip'
+ url 'https://www.silabs.com/Support%20Documents/Software/Mac_OSX_VCP_Driver.zip'
name 'Silicon Labs VCP Driver'
name 'CP210x USB to UART Bridge VCP Driver'
homepage 'http://www.silabs.com/products/mcu/pages/usbtouartbridgevcpdrivers.aspx'
license :gratis
container :nested => 'SiLabsUSBDriverDisk.dmg'
- pkg 'Silicon Labs VCP Driver Installer.mpkg'
+ pkg 'Silicon Labs VCP Driver.pkg'
uninstall :pkgutil => 'com.silabs.siliconLabsVcpDriver.*'
end
|
Update Silicon Labs VCP Driver
|
diff --git a/HammingDistance/Ruby/hamming_distance.rb b/HammingDistance/Ruby/hamming_distance.rb
index abc1234..def5678 100644
--- a/HammingDistance/Ruby/hamming_distance.rb
+++ b/HammingDistance/Ruby/hamming_distance.rb
@@ -0,0 +1,14 @@+# take two binary strings and returns the Hamming Distance between them
+def hamming_distance(string1, string2)
+ if string1.length != string2.length
+ return "Strings must be the same length."
+ else
+ total = 0
+ for i in 0...string1.length
+ if string1[i] != string2[i]
+ total += 1
+ end
+ end
+ return total
+ end
+end
|
Add Ruby Hamming Distance algorithm.
|
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
index abc1234..def5678 100644
--- a/config/initializers/secret_token.rb
+++ b/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Vdash::Application.config.secret_token = 'd831456343bb7f6c9b1bc04ce8d4748d9a6378a9dcd7bd7f6a495d3c6edfd6e8f5500d4d4ae4da3bc4bdc3ffc2aaa599403fd71431e7745c6b869c2ef2a0a318'
+Vdash::Application.config.secret_token = ENV['RS_SECRET_KEY']
|
Make cookie secret token actually a secret
|
diff --git a/core_gem/lib/deep_cover/auto_run.rb b/core_gem/lib/deep_cover/auto_run.rb
index abc1234..def5678 100644
--- a/core_gem/lib/deep_cover/auto_run.rb
+++ b/core_gem/lib/deep_cover/auto_run.rb
@@ -8,6 +8,7 @@ class Runner
include Tools::AfterTests
def initialize
+ @saved = false
end
def run!
@@ -24,11 +25,14 @@ private
def save
+ return if @saved
require_relative '../deep_cover'
DeepCover.persistence.save_trackers(DeepCover::GlobalVariables.tracker_hits_per_paths)
+ @saved = true
end
def report(**options)
+ save # Some of the hooks seem to do things in reverse order. Not sure if all of them.
coverage = Coverage.load
coverage.report(**options)
end
|
Make sure AutoRun saves before reporting
|
diff --git a/Casks/omnioutliner-beta.rb b/Casks/omnioutliner-beta.rb
index abc1234..def5678 100644
--- a/Casks/omnioutliner-beta.rb
+++ b/Casks/omnioutliner-beta.rb
@@ -1,6 +1,6 @@ cask :v1 => 'omnioutliner-beta' do
- version '4.3.x-r238997'
- sha256 '7abf46e9183ba617edc9d80e7587a32e3e555d5ca5868668f5bb7759f7b472c5'
+ version '4.4.x-r244801'
+ sha256 '45b7636ef8ab3c28aad9280fdf5317b7bf2ddda559673e1ae331b4fa982438e5'
url "http://omnistaging.omnigroup.com/omnioutliner-4/releases/OmniOutliner-#{version}-Test.dmg"
name 'OmniOutliner'
|
Update OmniOutliner Beta to version 4.4.x-r244801
This commit updates the version and sha256 stanzas.
|
diff --git a/lib/appsignal/integrations/unicorn.rb b/lib/appsignal/integrations/unicorn.rb
index abc1234..def5678 100644
--- a/lib/appsignal/integrations/unicorn.rb
+++ b/lib/appsignal/integrations/unicorn.rb
@@ -1,4 +1,4 @@-if defined?(::Unicorn) && defined?(::Unicorn::HttpServer)
+if defined?(::Unicorn)
Appsignal.logger.info('Loading Unicorn integration')
# We'd love to be able to hook this into Unicorn in a less
|
Make Unicorn check consistent with other integrations
|
diff --git a/activerecord-safer_migrations.gemspec b/activerecord-safer_migrations.gemspec
index abc1234..def5678 100644
--- a/activerecord-safer_migrations.gemspec
+++ b/activerecord-safer_migrations.gemspec
@@ -20,5 +20,5 @@
gem.add_development_dependency "pg", "~> 0.21.0"
gem.add_development_dependency "rspec", "~> 3.7.0"
- gem.add_development_dependency "rubocop", "~> 0.50.0"
+ gem.add_development_dependency "rubocop", "~> 0.51.0"
end
|
Update rubocop requirement to ~> 0.51.0
Updates the requirements on [rubocop](https://github.com/bbatsov/rubocop) to permit the latest version.
- [Release notes](https://github.com/bbatsov/rubocop/releases)
- [Changelog](https://github.com/bbatsov/rubocop/blob/master/CHANGELOG.md)
|
diff --git a/lib/capistrano/git/plugins/hoptoad.rb b/lib/capistrano/git/plugins/hoptoad.rb
index abc1234..def5678 100644
--- a/lib/capistrano/git/plugins/hoptoad.rb
+++ b/lib/capistrano/git/plugins/hoptoad.rb
@@ -9,7 +9,7 @@ local_user = ENV['USER'] || ENV['USERNAME']
executable = fetch(:rake, (RUBY_PLATFORM.downcase.include?('mswin') ? 'rake.bat' : 'rake'))
executable = "cd #{deploy_to} && sudo #{executable}" if executable.include?('bundle exec')
- notify_command = "#{executable} hoptoad:deploy TO=#{rails_env} REPO=#{repository} USER=#{local_user} RAILS_ENV=production"
+ notify_command = "#{executable} hoptoad:deploy TO=#{rails_env} REPO=#{repository} USER=#{local_user} RAILS_ENV=#{rails_env}"
notify_command << " API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
puts "\n\n### NOTIFY HOPTOAD: Notifying Hoptoad of Deploy (#{notify_command})\n\n"
run "#{notify_command}"
|
Use current environment not production
|
diff --git a/app/decorators/author_decorator.rb b/app/decorators/author_decorator.rb
index abc1234..def5678 100644
--- a/app/decorators/author_decorator.rb
+++ b/app/decorators/author_decorator.rb
@@ -11,8 +11,7 @@
def image
source.avatar.thumb.url or
- source.try :image or
- "https://secure.gravatar.com/avatar/1c02274fedcce55a289172bfb8db25ab.jpg"
+ source.try :image
end
def image_link
|
Remove Code School avatar fallback.
It made it harder to see who didn't have a photo.
|
diff --git a/aus/recipes/fix-raid-mapping.rb b/aus/recipes/fix-raid-mapping.rb
index abc1234..def5678 100644
--- a/aus/recipes/fix-raid-mapping.rb
+++ b/aus/recipes/fix-raid-mapping.rb
@@ -0,0 +1,10 @@+
+# Cookbook Name:: mh-opsworks-recipes
+# Recipe:: fix-raid-mapping
+
+# Fix RAID array boot-time mapping bug: http://ubuntuforums.org/showthread.php?t=1764861&page=2
+execute 'fix RAID array boot-time mapping bug' do
+ command "update-initramfs -u"
+ retries 5
+ retry_delay 5
+end
|
Fix RAID array boot-time mapping bug
|
diff --git a/lib/jeweler/templates/rspec/helper.rb b/lib/jeweler/templates/rspec/helper.rb
index abc1234..def5678 100644
--- a/lib/jeweler/templates/rspec/helper.rb
+++ b/lib/jeweler/templates/rspec/helper.rb
@@ -1,4 +1,3 @@-<%= render_template 'bundler_setup.erb' %>
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require '<%= require_name %>'
|
Remove bundler setup block, since RSpec2 supports activating Bundler.
|
diff --git a/lib/puppet/parser/functions/smooth.rb b/lib/puppet/parser/functions/smooth.rb
index abc1234..def5678 100644
--- a/lib/puppet/parser/functions/smooth.rb
+++ b/lib/puppet/parser/functions/smooth.rb
@@ -1,5 +1,3 @@-# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2
-
module Puppet::Parser::Functions
newfunction(:smooth, :type => :rvalue) do |args|
raise(Puppet::ParseError, "smooth(): Wrong number of arguments " +
|
Remove Vim modeline from files
|
diff --git a/lib/rails_riemann_middleware/event.rb b/lib/rails_riemann_middleware/event.rb
index abc1234..def5678 100644
--- a/lib/rails_riemann_middleware/event.rb
+++ b/lib/rails_riemann_middleware/event.rb
@@ -10,11 +10,12 @@ @client = create_riemann_client
@reporting_host = options[:reporting_host]
@tags = options.fetch(:tags, [])
+ @attributes = options.fetch(:attributes, {})
end
def <<(msg)
msg[:tags] += Array(tags)
- client << {:time => time_for_client, :host => reporting_host}.merge(msg)
+ client << {:time => time_for_client, :host => reporting_host}.merge(@attributes).merge(msg)
end
def app_prefix
|
Add support for passing custom attributes to Riemann
The attributes are passed in through options on the middleware
and are sent to Riemann on every event.
|
diff --git a/api/app/mailers/club_application_mailer.rb b/api/app/mailers/club_application_mailer.rb
index abc1234..def5678 100644
--- a/api/app/mailers/club_application_mailer.rb
+++ b/api/app/mailers/club_application_mailer.rb
@@ -17,7 +17,7 @@ to.display_name = 'Hack Club Team'
subject = "Hack Club Application (#{@application.full_name}, "\
- "#{@application.high_school})"
+ "#{@application.high_school}, #{@application.id})"
mail(to: to.format, reply_to: @application.mail_address.format,
subject: subject)
|
Add ID to title of club application
|
diff --git a/app/serializers/assessment_serializer.rb b/app/serializers/assessment_serializer.rb
index abc1234..def5678 100644
--- a/app/serializers/assessment_serializer.rb
+++ b/app/serializers/assessment_serializer.rb
@@ -1,6 +1,5 @@ class AssessmentSerializer < ActiveModel::Serializer
embed :ids, include: true
- attributes :id, :score, :exemplary, :notes, :published, :created_at, :updated_at
- has_one :submission
+ attributes :id, :score, :exemplary, :notes, :published, :created_at, :updated_at, :submission_id
has_one :assessor
end
|
Fix for dashboard not displaying score correctly.
|
diff --git a/app/components/users/acount_link_cell.rb b/app/components/users/acount_link_cell.rb
index abc1234..def5678 100644
--- a/app/components/users/acount_link_cell.rb
+++ b/app/components/users/acount_link_cell.rb
@@ -5,5 +5,9 @@ property :email
property :person
+ def show
+ model ? render : ""
+ end
+
end
end
|
Fix error on nil user model
|
diff --git a/app/controllers/api/tokens_controller.rb b/app/controllers/api/tokens_controller.rb
index abc1234..def5678 100644
--- a/app/controllers/api/tokens_controller.rb
+++ b/app/controllers/api/tokens_controller.rb
@@ -12,7 +12,9 @@ mutate klass
.run(auth_params)
.tap { |result| maybe_halt_login(result) }
- .tap { |result| mark_as_seen(result.result[:user].device) }
+ .tap do |result|
+ mark_as_seen(result.result[:user].device) if result.result
+ end
end
end
|
Fix rollbar bug report 74
|
diff --git a/library/rubygems/gem/bin_path_spec.rb b/library/rubygems/gem/bin_path_spec.rb
index abc1234..def5678 100644
--- a/library/rubygems/gem/bin_path_spec.rb
+++ b/library/rubygems/gem/bin_path_spec.rb
@@ -2,6 +2,15 @@ require 'rubygems'
describe "Gem.bin_path" do
+ before :each do
+ @bundle_gemfile = ENV['BUNDLE_GEMFILE']
+ ENV['BUNDLE_GEMFILE'] = tmp("no-gemfile")
+ end
+
+ after :each do
+ ENV['BUNDLE_GEMFILE'] = @bundle_gemfile
+ end
+
it "finds executables of default gems, which are the only files shipped for default gems" do
# For instance, Gem.bin_path("bundler", "bundle") is used by rails new
Gem::Specification.each_spec([Gem::Specification.default_specifications_dir]) do |spec|
|
Make the Gem.bin_path even if there is a Gemfile.lock in a parent dir
|
diff --git a/app/models/drug_safety_update.rb b/app/models/drug_safety_update.rb
index abc1234..def5678 100644
--- a/app/models/drug_safety_update.rb
+++ b/app/models/drug_safety_update.rb
@@ -1,7 +1,7 @@ class DrugSafetyUpdate < AbstractDocument
def summary
- attrs.fetch(:description)
+ attrs.fetch(:description, nil)
end
def self.tag_metadata_keys
|
Handle Rummager not returning description
If a record in Rummager's search index doesn't have a description then
it will omit the field completely rather than returning a blank value.
That causes the `fetch` to blow up, so default it to `nil`.
|
diff --git a/app/models/pageflow/used_file.rb b/app/models/pageflow/used_file.rb
index abc1234..def5678 100644
--- a/app/models/pageflow/used_file.rb
+++ b/app/models/pageflow/used_file.rb
@@ -2,6 +2,7 @@ class UsedFile < SimpleDelegator
def initialize(file, usage = nil)
super(file)
+ @file = file
@usage = usage || file.usages.first
end
@@ -17,5 +18,16 @@ def usage_id
@usage.id
end
+
+ # Not delegated by default. Required to allow using instances in
+ # Active Record conditions.
+
+ def is_a?(klass)
+ @file.is_a?(klass)
+ end
+
+ def class
+ @file.class
+ end
end
end
|
Allow using UsedFile decorator in Active Record queries
Delegate low level methods to make it look like the original record.
|
diff --git a/em-hiredis.gemspec b/em-hiredis.gemspec
index abc1234..def5678 100644
--- a/em-hiredis.gemspec
+++ b/em-hiredis.gemspec
@@ -12,7 +12,7 @@ s.summary = %q{Eventmachine redis client}
s.description = %q{Eventmachine redis client using hiredis native parser}
- s.add_dependency 'hiredis', '~> 0.3.0'
+ s.add_dependency 'hiredis', '~> 0.4.0'
s.add_development_dependency 'em-spec', '~> 0.2.5'
s.add_development_dependency 'rspec', '~> 2.6.0'
|
Update hiredis dependency to 0.4.x
|
diff --git a/app/models/concerns/curation_concerns/collection.rb b/app/models/concerns/curation_concerns/collection.rb
index abc1234..def5678 100644
--- a/app/models/concerns/curation_concerns/collection.rb
+++ b/app/models/concerns/curation_concerns/collection.rb
@@ -2,7 +2,6 @@ module Collection
extend ActiveSupport::Concern
extend Deprecation
- include Hydra::Works::CollectionBehavior
include Hydra::WithDepositor # for access to apply_depositor_metadata
include Hydra::AccessControls::Permissions
include CurationConcerns::RequiredMetadata
|
Remove duplicate include in CurationConcerns::Collection
|
diff --git a/spec/controllers/webhook_controller_spec.rb b/spec/controllers/webhook_controller_spec.rb
index abc1234..def5678 100644
--- a/spec/controllers/webhook_controller_spec.rb
+++ b/spec/controllers/webhook_controller_spec.rb
@@ -10,7 +10,7 @@ let(:event_id) { 'evt_charge_succeeded' }
before do
- @event = stub_event(event_id)
+ stub_event(event_id)
end
it "should be successful" do
|
Remove extra ivar in spec
|
diff --git a/app/services/campaign_page_builder.rb b/app/services/campaign_page_builder.rb
index abc1234..def5678 100644
--- a/app/services/campaign_page_builder.rb
+++ b/app/services/campaign_page_builder.rb
@@ -54,7 +54,7 @@ end
def default
- ENV['DEFAULT_PLUGIN_REGISTRATION'] || true
+ ENV['DEFAULT_PLUGIN_REGISTRATION'] || false
end
end
|
Set DEFAULT_PLUGIN_REGISTRATION as false when undefined
|
diff --git a/src/orders_finder.rb b/src/orders_finder.rb
index abc1234..def5678 100644
--- a/src/orders_finder.rb
+++ b/src/orders_finder.rb
@@ -14,10 +14,14 @@ end
def orders
- order_numbers.map { |order_number| find_order(order_number) }
+ all_orders.sort_by { |order| order[:progress] }.reverse
end
private
+
+ def all_orders
+ order_numbers.map { |order_number| find_order(order_number) }
+ end
def find_order(order_number)
parser = order_parser(order_number)
|
Sort all orders by progress
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.