aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | | Merge pull request #6525 from freerange/minitest-passthrough-exceptionsJosé Valim2012-05-292-8/+62
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Exceptions like Interrupt & NoMemoryError should not be rescued in tests.
| * | | | | | | | | Avoid dependency on MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.James Mead2012-05-291-2/+10
| | | | | | | | | |
| * | | | | | | | | Exceptions like Interrupt should not be rescued.James Mead2012-05-282-8/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neither Test::Unit nor MiniTest rescue exceptions like Interrupt or NoMemoryError, but ActiveSupport::Testing::SetupAndTeardown#run which overrides MiniTest::Unit::TestCase#run rescues them. Rescuing an Interrupt exception is annoying, because it means when you are running a lot of tests e.g. when running one of the rake test tasks, you cannot break out using ctrl-C. Rescuing exceptions like NoMemoryError is foolish, because the most sensible thing to happen is for the process to terminate as soon as possible. This solution probably needs some finessing e.g. I'm not clear whether the assumption is that only MiniTest is supported. Also early versions of MiniTest did not have this behaviour. However, hopefully it's a start. Integrating with Test::Unit & MiniTest has always been a pain. It would be great if both of them provided sensible extension points for the kind of things that both Rails and Mocha want to do.
* | | | | | | | | | Merge pull request #6528 from frodsan/update_hash_syntax_gemfile_templateJosé Valim2012-05-291-1/+1
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | update Gemfile template to 1.9 hash syntax
| * | | | | | | | | | update Gemfile template to 1.9 hash syntaxFrancesco Rodriguez2012-05-291-1/+1
|/ / / / / / / / / /
* | | | | | | | | | Merge pull request #6526 from appfolio/decoupling_activesupport_from_actionivewCarlos Antonio da Silva2012-05-282-4/+44
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Decoupling ActiveSupport from ActionView
| * | | | | | | | | | decoupling activesupport performance testing from actionview and adding testsAndrew Mutz2012-05-282-4/+44
|/ / / / / / / / / /
* | | | | | | | | | Merge pull request #6527 from frodsan/add_test_to_delete_by_fixnum_or_stringCarlos Antonio da Silva2012-05-281-0/+20
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Add tests to delete by fixnum or string id with has many through associations
| * | | | | | | | | | Add tests to delete by fixnum or string id with has many through associationsFrancesco Rodriguez2012-05-281-0/+20
|/ / / / / / / / / /
* | | | | | | | | | Add note about CollectionAssociation#delete change to upgrading guide [ci skip]Carlos Antonio da Silva2012-05-291-0/+4
| | | | | | | | | |
* | | | | | | | | | Fix failing build related to change in CollectionAssociation#deleteCarlos Antonio da Silva2012-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge commit 6f1d9d00ffd9d411b2bd488da4eb92b7e2fd972e
* | | | | | | | | | Review requires from number helperCarlos Antonio da Silva2012-05-283-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of these requires are now only necessary in ActiveSupport::NumberHelper. Add hash/keys require due to symbolize_keys usage in number helpers. Also remove some whitespaces. Closes #6414
* | | | | | | | | | Yield only one argument instead of splatting.Carlos Antonio da Silva2012-05-282-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Changelog entry. Closes #4003
* | | | | | | | | | Allow blocks for count with ActiveRecord::Relation. Document and test that ↵chrisfinne2012-05-282-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sum allows blocks
* | | | | | | | | | Merge pull request #6511 from frodsan/add_fixnum_string_support_for_deleteCarlos Antonio da Silva2012-05-284-3/+57
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Add support for CollectionAssociation#delete by Fixnum or String
| * | | | | | | | | | Add support for CollectionAssociation#delete by Fixnum or StringFrancesco Rodriguez2012-05-284-3/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found the next issue between CollectionAssociation `delete` and `destroy`. class Person < ActiveRecord::Base has_many :pets end person.pets.destroy(1) # => OK, returns the destroyed object person.pets.destroy("2") # => OK, returns the destroyed object person.pets.delete(1) # => ActiveRecord::AssociationTypeMismatch person.pets.delete("2") # => ActiveRecord::AssociationTypeMismatch Adding support for deleting with a fixnum or string like `destroy` method.
* | | | | | | | | | | Parse float value only once in number helpersCarlos Antonio da Silva2012-05-281-11/+11
|/ / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor number helpers output with safety handling to call float parsing only once. Also remove 'erb' require.
* | | | | | | | | | Merge pull request #6522 from lest/patch-1José Valim2012-05-283-5/+1
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | ActiveSupport require and dependencies
| * | | | | | | | | make AS::Multibyte::Chars work w/o multibyte core extSergey Nartimov2012-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use ActiveSupport::Multibyte::Chars.new instead of String#mb_chars. It allows to use ActiveSupport::Multibyte::Chars without requiring String multibyte core extension.
| * | | | | | | | | remove unnecessary requireSergey Nartimov2012-05-282-4/+0
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AS::Multibyte are no longer required by access and filters string core extensions.
* | | | | | | | | Merge pull request #6517 from purcell/validates-false-valueJosé Valim2012-05-283-0/+8
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Don't enable validations when passing false hash values to ActiveModel.validates
| * | | | | | | | | Don't enable validations when passing false hash values to ActiveModel.validatesSteve Purcell2012-05-283-0/+8
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing a falsey option value for a validator currently causes that validator to be enabled, just like "true": ActiveModel.validates :foo, :presence => false This is rather counterintuitive, and makes it inconvenient to wrap `validates` in methods which may conditionally enable different validators. As an example, one is currently forced to write: def has_slug(source_field, options={:unique => true}) slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? } before_validation slugger validations = { :presence => true, :slug => true } if options[:unique] validations[:uniqueness] = true end validates :slug, validations end because the following reasonable-looking alternative fails to work as expected: def has_slug(source_field, options={:unique => true}) slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? } before_validation slugger validates :slug, :presence => true, :slug => true, :uniqueness => options[:unique] end (This commit includes a test, and all activemodel and activerecord tests pass as before.)
* | | | | | | | | Merge pull request #6512 from jaredbeck/fix_number_to_currency_neg_formatJosé Valim2012-05-282-1/+3
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix handling of negative zero in number_to_currency
| * | | | | | | | | Fix handling of negative zero in number_to_currencyJared Beck2012-05-282-1/+3
|/ / / / / / / / /
* | | | | | | | | Merge pull request #6315 from ↵José Valim2012-05-2813-287/+1536
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appfolio/moving_number_helper_methods_to_active_support Moving number helper from ActionView to Active Support
| * | | | | | | | | Moving NumberHelpers from ActionView to ActiveSupportAndrew Mutz2012-05-2713-287/+1536
| | |_|_|/ / / / / | |/| | | | | | |
* / | | | | | | | Fix sorting of helpers from different pathsPiotr Sarnacki2012-05-286-2/+57
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When more than one directory for helpers is provided to a controller, it should preserver the order of directories. Given 2 paths: MyController.helpers_paths = ["dir1/helpers", "dir2/helpers"] helpers from dir1 should be loaded first. Before this commit, all helpers were mixed and then sorted alphabetically, which essentially would require to rename helpers to get desired order. This is a problem especially for engines, where you would like to be able to predict accurately which engine helpers will load first. (closes #6496)
* | | | | | | | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-275-17/+68
|\ \ \ \ \ \ \ \
| * | | | | | | | copy edits [ci skip]Vijay Dev2012-05-271-3/+3
| | | | | | | | |
| * | | | | | | | update Module#mattr_accessor documentation [ci skip]Francesco Rodriguez2012-05-261-6/+6
| | | | | | | | |
| * | | | | | | | remove unnecessary ruby 1.8 reference from active_record/core [ci skip]Francesco Rodriguez2012-05-261-3/+4
| | | | | | | | |
| * | | | | | | | add CollectionProxy#uniq documentationFrancesco Rodriguez2012-05-261-0/+21
| | | | | | | | |
| * | | | | | | | update Hash documentation with 1.9 syntax [ci skip]Francesco Rodriguez2012-05-261-8/+16
| | | | | | | | |
| * | | | | | | | add examples to Hash#deep_stringify_keys and Hash#deep_symbolize_keys [ci skip]Francesco Rodriguez2012-05-261-0/+10
| | | | | | | | |
| * | | | | | | | Add some information about handle_unverified_request to guides.Erich Menge2012-05-261-0/+11
| | | | | | | | |
| * | | | | | | | Revert "Small correction to contributing_to_rails in the section for testing ↵Deepak Kannan2012-05-261-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveRecord " This reverts commit 0cfbaa030a0684aaa89d3d3c85528e80c1995836. Sorry did not see the section on MySql and PostgreSQL # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: guides/source/contributing_to_ruby_on_rails.textile #
| * | | | | | | | Small correction to contributing_to_rails in the section for testing ↵Deepak Kannan2012-05-261-0/+6
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveRecord Initially the guide suggests to install gems via "bundle install --without db" But tests for ActiveRecord need to install the gems in db group also, like mysql. The patch clears the bundler options in ".bundle/config" and installs all the gems in Gemfile
* | | | | | | | Fix railties_order when application object is passedPiotr Sarnacki2012-05-272-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | railites_order method, introduced in 40b19e0, had a bug that was causing loading application instance twice in initializers if railties_order already included application instance. So for example railties_order = [Foo::Engine, :main_app, Bar::Engine] would result in such railties array: [MyApp::Application, Foo::Engine, MyAppApplication, Bar::Engine] In order to fix it, we need to check for existence of application in both railties_order and railties arrays.
* | | | | | | | Update initialization guide [ci skip]Vijay Dev2012-05-271-64/+32
| |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * update rails versions * remove outdated code snippets * few more corrections
* | | | | | | Add `:escape` option for `truncate`Rafael Mendonça França2012-05-263-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This options can be used to not escape the result by default.
* | | | | | | Update the documentation and add CHANGELOG entryRafael Mendonça França2012-05-263-4/+6
| | | | | | |
* | | | | | | Test that the block used in truncate is escaped if it is not HTML safeRafael Mendonça França2012-05-262-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring the truncate method to not do a sort-circuit return
* | | | | | | Merge pull request #6031 from lellisga/truncate_readmeRafael Mendonça França2012-05-263-10/+45
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | Truncate now has the ability to receive a html option that allows it to call rails helpers.
| * | | | | | Truncate now has the ability to receive a html option that allows it to call ↵Li Ellis Gallardo2012-05-263-10/+45
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rails helpers. This way if my text is long I don't have to do something like this: .text = truncate(@text, :length => 27) if @text.size >= 27 = link_to "continue", notes_path, ....."")
* | | | | | some small corrections & wrapping changes in the initialization guideVijay Dev2012-05-261-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | This guide is currently a wip and pending reviews. [ci skip]
* | | | | | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-2611-76/+344
|\ \ \ \ \ \
| * | | | | | fix mention of ruby versions that rails 4 won't run on [ci skip]Vijay Dev2012-05-261-1/+1
| | | | | | |
| * | | | | | make it explicit that bundle install at the time of app creationVijay Dev2012-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | installs only the gems that are already in the gemfile [ci skip]
| * | | | | | [routing guide] Add mention of get '/:username' routeRyan Bigg2012-05-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is fairly common in Rails applications and is requested a lot of the time on Stack Overflow and #rubyonrails
| * | | | | | add :nodoc: to CollectionProxy#initializeFrancesco Rodriguez2012-05-251-1/+1
| | | | | | |