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
| 2013-01-25 18:06:55.146 Stride[86479:c07] *** -[__NSCFCalendar components:fromDate:]: date cannot be nil | |
| I mean really, what do you think that operation is supposed to mean with a nil date? | |
| An exception has been avoided for now. | |
| A few of these errors are going to be reported with this complaint, then further violations will simply silently do whatever random thing results from the nil. | |
| Here is the backtrace where this occurred this time (some frames may be missing due to compiler optimizations): | |
| ( | |
| 0 CoreFoundation 0x02425a75 -[__NSCFCalendar components:fromDate:] + 85 |
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
| function! SetupCoverage() | |
| if filereadable("coverage.vim") | |
| source coverage.vim | |
| endif | |
| endfunction | |
| if has("autocmd") | |
| autocmd FileType ruby call SetupCoverage() | |
| endif |
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
| var Activity = (function() { | |
| var count = 0; | |
| var show = $.fancybox.showActivity; | |
| var hide = $.fancybox.hideActivity; | |
| var start = function() { | |
| ++count; | |
| show(); | |
| }; |
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 'virtus' | |
| class Foo | |
| include Virtus | |
| attribute :id, Integer | |
| attribute :date, Date | |
| attribute :foo, String | |
| def initialize(attributes = {}) |
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 Foo | |
| extend AutoCoercions | |
| coerce :date_gte, :date_lte, with: :to_date | |
| coerce :trip_mode_eq, :trip_purpose_eq, :trip_count_gte, with: :to_i | |
| coerce :select_random_winners, with: ->(v) { v == '1' } | |
| coerce :random_winner_count, with: :to_i | |
| def initialize(attributes = {}) | |
| @attributes = self.class.apply_coercions(attributes) |
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
| ActiveAdmin.register Foo do | |
| collection_action :foo | |
| 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
| deliveries = ActionMailer::Base.deliveries. # <= note extra `.` | |
| assert_equal I18n.t('user_mailer.bid_confirmation_email.subject'), deliveries.first.subject | |
| # => NoMethodError: undefined method `first' for nil:NilClass |
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
| en: | |
| date: | |
| formats: | |
| default: <%= Stamp.strftime_format("March 1, 1999") %> | |
| short: <%= Stamp.strftime_format("Mon Jan 1") %> | |
| ordinal: <%= Stamp.strftime_format("1st of Jan") %> | |
| time: | |
| formats: | |
| default: etc... |
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
| controller do | |
| def create | |
| # Extend create to set the current user in your model here | |
| create! | |
| 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
| # your-engine/lib/magic/rails/engine.rb | |
| module Magic | |
| module Rails | |
| module Engine | |
| ## | |
| # Automatically append all of the current engine's routes to the main | |
| # application's route set. This needs to be done for ALL functional tests that | |
| # use engine routes, since the mounted routes don't work during tests. | |
| # |