This file contains 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
# Extensions to gems/actionpack-3.2.13/lib/action_view/helpers/form_helper.rb | |
=begin | |
A version of InstanceTag.value_before_type_cast that returns a string in ISO-8601 format for Date columns. | |
The original behavior of value_before_type_cast was to return the Date object itself. But the default to_s on a Date returns a string like "June 5, 2013". | |
However, HTML5 date input fields expect their values to be in ISO-8601 format ("2013-06-05") and won't recognize the value if it is in some other format. | |
This makes it so you can simply do this: |
This file contains 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
[Desktop Entry] | |
Encoding=UTF-8 | |
Name=Vim (Console) | |
Comment=Edit text files in a console using Vim | |
Exec=/usr/local/bin/open_txmt_link_in_vim %U | |
Terminal=false | |
Type=Application | |
Icon=/usr/src/vim/runtime/vim48x48.xpm | |
Categories=Application;Utility;TextEditor; | |
MimeType=text/plain;x-scheme-handler/vim;x-scheme-handler/txmt; |
This file contains 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
module Enumerable | |
# Returns an array of arrays, each inner array containing a cluster of contiguous elements from | |
# self. | |
# | |
# [-1, 0, 1, 3, 4, 7, 8].clusters_of_contiguous | |
# => [[-1, 0, 1], [3, 4], [7, 8]] | |
# | |
# Based off of Enumerable#cluster (from facets gem) | |
# | |
def clusters_of_contiguous |
This file contains 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
module ActiveRecord | |
module NestedAttributes #:nodoc: | |
ClassMethods.class_eval do | |
def accepts_nested_attributes_for(*attr_names) | |
options = { :allow_destroy => false, :update_only => false } | |
options.update(attr_names.extract_options!) | |
options.assert_valid_keys(:allow_destroy, :reject_if, :limit, :update_only) | |
options[:reject_if] = REJECT_ALL_BLANK_PROC if options[:reject_if] == :all_blank | |
attr_names.each do |association_name| |
This file contains 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
> bundle exec rspec --backtrace spec/rspec/core/subject_spec.rb | |
Run options: | |
include {:focus=>true} | |
exclude {:ruby=>#<Proc:./spec/spec_helper.rb:84>} | |
All examples were filtered out; ignoring {:focus=>true} | |
...FF......................... | |
Failures: |
This file contains 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
These are the 3 places that together caused the nested calls to synchronize: | |
/home/tyler/.rvm/gems/ruby-1.9.3-p125/bundler/gems/capybara-555008c74751/lib/capybara/node/finders.rb:29:in `find' | |
def find(*args) | |
query = query(*args) | |
query.find = true | |
synchronize do | |
results = resolve(query) | |
query.verify!(results) | |
results.first |
This file contains 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
> rake cucumber | |
WARNING: Possible conflict with Rake extension: String#ext already exists | |
WARNING: Possible conflict with Rake extension: String#pathmap already exists | |
/home/tyler/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S bundle exec cucumber --profile default | |
Using the default profile... | |
Feature: Cucumber step definitions | |
@javascript | |
Scenario: When I do a capybara search that triggers the nested synchronize bug # features/reproduce_bug.feature:3 | |
==================================================================================================== |
This file contains 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
> rake cucumber | |
WARNING: Possible conflict with Rake extension: String#ext already exists | |
WARNING: Possible conflict with Rake extension: String#pathmap already exists | |
/home/tyler/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S bundle exec cucumber --profile default | |
Using the default profile... | |
Feature: Cucumber step definitions | |
@javascript | |
Scenario: When I do a capybara search that triggers the nested synchronize bug # features/reproduce_bug.feature:3 | |
0 retries=40 e=#<Capybara::ElementNotFound: Unable to find css ".some_div_that_doesnt_exist"> |
This file contains 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
The FK attributes in the new record used to be set by set_belongs_to_association_for | |
(which the composite_primary_keys was overriding to work with CPK in its AR 3.0 series), | |
until this change in ActiveRecord: | |
commit e8ada11aac28f0850f0e485acacf34e7eb81aa19 | |
Author: Jon Leighton <j@jonathanleighton.com> | |
Date: Fri Dec 24 00:29:04 2010 +0000 | |
Associations: DRY up the code which is generating conditions, and make it all use arel rather than SQL strings |
This file contains 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
1) Error: | |
test_to_key_with_composite_keys(TestAttributeMethods): | |
ActiveRecord::RecordNotFound: Couldn't find ReferenceCode with ID=1,1 WHERE `reference_codes`.`reference_type_id` = 1 AND `reference_codes`.`reference_code` = 1 | |
/home/tyler/dev/rails/composite_primary_keys/lib/composite_primary_keys/relation/finder_methods.rb:111:in `block in find_with_ids' | |
/home/tyler/dev/rails/composite_primary_keys/lib/composite_primary_keys/relation/finder_methods.rb:91:in `map' | |
/home/tyler/dev/rails/composite_primary_keys/lib/composite_primary_keys/relation/finder_methods.rb:91:in `find_with_ids' | |
/home/tyler/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/relation/finder_methods.rb:107:in `find' | |
/home/tyler/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.3/lib/active_record/querying.rb:5:in `find' | |
/home/tyler/dev/rails/composite_primary_keys/test/test_attribute_methods.rb:27:in `test_to_key_with_composite_keys' |