This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UpdateCache < ActiveRecord::Migration | |
| def up | |
| User.all.each do |user| | |
| User.reset_counters(user.id, :pets) | |
| end | |
| end | |
| def down | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| == TestingAgain: migrating =================================================== | |
| #<User:0x000000025e8bf0> | |
| #<User:0x000000025e7688> | |
| #<User:0x00000003a93c08> | |
| #<User:0x00000003a928f8> | |
| rake aborted! | |
| An error has occurred, this and all later migrations canceled: | |
| uninitialized constant User::Pet/home/deploy/test/tressonia/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/inheritance.rb:111:in `compute_type' | |
| /home/deploy/test/tressonia/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/reflection.rb:172:in `klass' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| Dim strMode | |
| Dim strRTUserName | |
| Dim strRTPassword | |
| Dim strRTURL | |
| Dim strRTAuthData | |
| Dim objNetwork | |
| Dim strComputerName | |
| Dim strCurrentUser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Monkey patch in requiring nsec as the cache timestamp format. | |
| module ActiveRecord | |
| class Base | |
| self.cache_timestamp_format = :nsec | |
| end | |
| end | |
| module ActiveRecord | |
| module ConnectionAdapters | |
| class Mysql2Adapter < AbstractMysqlAdapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe Car do | |
| let(:manufacturer) { FactoryGirl.create(:manufacturer)} | |
| let(:car) { FactoryGirl.create(:car, manufacturer: manufacturer)} | |
| it "basic_articles with no extras required" do | |
| basic_article = FactoryGirl.create(:basic_article, requires_extra: false) | |
| expect(manufacturer.selectable_cars.count).to eq(1) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MainsController < ApplicationController | |
| def index | |
| [City, State, Country].each do |klass| | |
| @search = klass.search(params[:q]) | |
| @result = @search.result | |
| break unless @result.blank? | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "relationships" do | |
| before(:each) do | |
| @new_object = DummyAsset.new | |
| @new_object.title = "subbla" | |
| @new_object.save | |
| subject.title = "bla" | |
| subject.descMetadata.creator = @new_object | |
| end | |
| it "should have accessible relationship attributes" do | |
| expect(subject.descMetadata.license.title).to eq "subbla" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Run options: include {:locations=>{"./spec/controllers/shelters_controller_spec.rb"=>[61]}} | |
| SheltersController | |
| Fails to PATCH update when submitting invalid data | |
| "#<ActiveModel::Errors:0x00000005446ad8 @base=#<Shelter id: 1, name: nil, phone_number: \"606-555-1212\", | |
| contact_person: \"Shelter Contact\", rescue_group_id: nil, created_at: \"2013-12-27 20:33:10\", | |
| updated_at: \"2013-12-27 20:33:10\">, @messages={:name=>[\"can't be blank\"]}>" | |
| "#<ActionDispatch::Flash::FlashHash:0x000000068fdd28 @discard=#<Set: {}>, | |
| @flashes={:notice=>\"Successfully updated Shelter!\"}, @now=nil>" | |
| fails to update a shelter with bad info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| default: | |
| plugins: | |
| - textcolor | |
| - link | |
| - fullscreen | |
| - preview | |
| - code | |
| - contextmenu | |
| - paste |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe Project do | |
| let!(:user) { FactoryGirl.create(:user) } | |
| let!(:plan) { FactoryGirl.create(:plan_with_subscription, user: user) } | |
| it "has a valid factory" do | |
| FactoryGirl.create(:project, user: user). should be_valid | |
| end |