aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | [ci skip] Fix `:having` option with `having` methodyui-knk2015-04-011-1/+1
|/ / /
* | | Merge pull request #19605 from 1337807/patch-1Rafael Mendonça França2015-04-011-0/+12
|\ \ \ | | | | | | | | | | | | Update routing.md
| * | | Update routing.mdJonan Scheffler2015-04-011-0/+12
|/ / / | | | | | | | | | | | | | | | This adds instructions for routing to rack applications with mount instead of match. I just spent an unreasonable amount of time staring at this, hopefully the next person will save some time. It's possible that the docs should simply advise people to use mount and leave out the match method but I don't know enough about the differences in the two approaches to assert that definitively.
* | | Merge pull request #19604 from aaronjensen/speed-up-time-coercionRafael Mendonça França2015-04-011-2/+4
|\ \ \ | | | | | | | | Only coerce time when comparing if necessary
| * | | Only coerce time when comparing if necessaryAaron Jensen2015-03-311-2/+4
|/ / / | | | | | | | | | | | | | | | In dev, ActiveSupport::FileUpdateChecker#max_mtime triggers many time comparisons. Time#to_time is quite a bit slower than not doing it, so we should avoid it if possible.
* | | Merge pull request #19586 from mechanicles/fix-eager-loading-for-find-methodsRafael Mendonça França2015-03-312-1/+18
|\ \ \ | | | | | | | | Fix eager loading association using default_scope for finder methods.
| * | | Fix eager loading association using default_scope for finder methods.Santosh Wadghule2015-03-312-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | - Eager loading was not working for the default_scope (class method) for 'find' & 'find_by' methods. - Fixed these by adding a new check 'respond_to?(:default_scope)'.
* | | | Merge pull request #19603 from eliotsykes/remove-considerations-sectionRafael Mendonça França2015-03-311-9/+0
|\ \ \ \ | | | | | | | | | | Remove unused subdir deployment considerations section [ci skip]
| * | | | Remove unused subdir deployment considerations section [ci skip]Eliot Sykes2015-03-311-9/+0
|/ / / /
* | | | Make method as nodoc since we are already docummenting at AbstractAdapterRafael Mendonça França2015-03-311-1/+1
| | | |
* | | | Merge pull request #19599 from y-yagi/application_job_templateCarlos Antonio da Silva2015-03-311-1/+0
|\ \ \ \ | | | | | | | | | | remove extra newline from ApplicationJob template
| * | | | remove extra newline from ApplicationJob templateyuuji.yaginuma2015-03-311-1/+0
|/ / / /
* | | | Merge pull request #19596 from yui-knk/fix/comment_alias_attributeArthur Nogueira Neves2015-03-311-1/+1
|\ \ \ \ | | | | | | | | | | [ci skip] Replace `query methods` with `a predicate`
| * | | | [ci skip] Replace `query methods` with `a predicate`yui-knk2015-03-311-1/+1
|/ / / /
* | | | Merge pull request #19595 from claudiob/fix-docs-set-callbackYves Senn2015-03-311-4/+6
|\ \ \ \ | | | | | | | | | | Fix doc: set_callback also accepts an array of if:
| * | | | Fix doc: set_callback also accepts an array of if:claudiob2015-03-311-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Active Record calls `set_callback` inside `after_commit`, [these lines of code](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/transactions.rb#L276) pass an **array** of methods as the `:if` condition: ```ruby options[:if] = Array(options[:if]) options[:if] << "transaction_include_any_action?(#{fire_on})" ``` That made me realize that anyone could pass an **array** of `:if` and `:unless` conditions to `set_callback`, since Active Support transforms these conditions into an array anyways in [these lines of code](https://github.com/rails/rails/blob/master/activesupport/lib/active_support/callbacks.rb#L365): ```ruby @if = Array(options[:if]) @unless = Array(options[:unless]) ``` Long story short, this commit updates the documentation of the `set_callback` method to explain that arrays are also accepted. It also replaces +false+ and +true+ with false and true, since any _falsey_ or _truthy_ value will work. [ci skip]
* | | | | Merge pull request #19523 from kuldeepaggarwal/fix-table-name-conflictYves Senn2015-03-312-2/+4
|\ \ \ \ \ | |/ / / / |/| | | | rename `widgets` table to `new_widgets`
| * | | | use Model.reset_column_information to clear table cache connection wide.Kuldeep Aggarwal2015-03-312-2/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `widgets` table is being created in `primary_keys_test.rb` for PostgreSQLAdapter, MysqlAdapter, Mysql2Adapter and it makes test to fail earlier. Before: `bundle exec rake mysql2:test` ``` Finished in 127.287669s, 35.5258 runs/s, 97.8885 assertions/s. 1) Error: PersistenceTest::SaveTest#test_save_touch_false: ActiveModel::UnknownAttributeError: unknown attribute 'name' for #<Class:0x0000000a7d6ef0>. /home/kd/projects/kd-rails/activerecord/lib/active_record/attribute_assignment.rb:36:in `rescue in _assign_attribute' /home/kd/projects/kd-rails/activerecord/lib/active_record/attribute_assignment.rb:34:in `_assign_attribute' /home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:40:in `block in _assign_attributes' /home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:39:in `each' /home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:39:in `_assign_attributes' /home/kd/projects/kd-rails/activerecord/lib/active_record/attribute_assignment.rb:26:in `_assign_attributes' /home/kd/projects/kd-rails/activemodel/lib/active_model/attribute_assignment.rb:33:in `assign_attributes' /home/kd/projects/kd-rails/activerecord/lib/active_record/core.rb:293:in `initialize' /home/kd/projects/kd-rails/activerecord/lib/active_record/inheritance.rb:61:in `new' /home/kd/projects/kd-rails/activerecord/lib/active_record/inheritance.rb:61:in `new' /home/kd/projects/kd-rails/activerecord/lib/active_record/persistence.rb:50:in `create!' /home/kd/projects/kd-rails/activerecord/test/cases/persistence_test.rb:913:in `test_save_touch_false' 4522 runs, 12460 assertions, 0 failures, 1 errors, 4 skips ``` After: `bundle exec rake mysql2:test` ``` Finished in 135.785086s, 33.3026 runs/s, 91.7774 assertions/s. 4522 runs, 12462 assertions, 0 failures, 0 errors, 4 skips ```
* | | | Merge pull request #19594 from radar/require-module-delegationGuillermo Iguaran2015-03-301-0/+1
|\ \ \ \ | | | | | | | | | | Require Module#delegate core ext in ActiveModel::Naming
| * | | | Require Module#delegate core ext in ActiveModel::NamingRyan Bigg2015-03-311-0/+1
| | | | |
* | | | | Merge pull request #19592 from adimitri/activerecord-find-ambiguityRafael Mendonça França2015-03-301-3/+1
|\ \ \ \ \ | | | | | | | | | | | | Combine complementary AR #find doc lines
| * | | | | [ci skip] Combine complementary AR #find doc linesAlexander Dimitriyadi2015-03-301-3/+1
|/ / / / /
* | | | | Require the extensions to tests pass in isolationRafael Mendonça França2015-03-301-0/+1
| | | | |
* | | | | Merge pull request #19021 from morgoth/activemodel-errors-refactoringRafael Mendonça França2015-03-302-24/+10
|\ \ \ \ \ | | | | | | | | | | | | Simplify and alias ActiveModel::Errors methods where possible
| * | | | | Simplify and alias ActiveModel::Errors methods where possibleWojciech Wnętrzak2015-02-202-24/+10
| | | | | |
* | | | | | Revert "Remove Array#inquiry"Rafael Mendonça França2015-03-304-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9420de59f5b7f5ceac77e28e6c326ec145f71f80. Reason: Turns out we want to keep this method.
* | | | | | Merge pull request #19034 from jvanbaarsen/explicit-job-base-classMatthew Draper2015-03-308-6/+33
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | Add explicit base class for ActiveJob jobs
| * | | | | Add explicit base class for ActiveJob jobsJeroen van Baarsen2015-03-238-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Jobs generated now inherent from ApplicationJob * ApplicationJob inherents from ActiveJob::Base * Added entry to changelog Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* | | | | | Merge pull request #19587 from rails/rm-sprockets-3Rafael Mendonça França2015-03-295-17/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | Test using sprockets 3
| * | | | | | Test using sprockets 3Rafael Mendonça França2015-03-295-17/+16
|/ / / / / /
* | | | | | Merge pull request #19581 from kirs/bin-deprecation-versionRafael Mendonça França2015-03-291-1/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Replace `in Rails 4` with `in Rails %version%` in deprecation message
| * | | | | | Replace `in Rails 4` with `in Rails %version%` in deprecation messageKir Shatrov2015-03-291-1/+2
| | | | | | |
* | | | | | | Merge pull request #19585 from sgrif/sg-deprecate-tokenizerRafael Mendonça França2015-03-293-12/+51
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Deprecate the `:tokenizer` option to `validates_length_of`
| * | | | | | | Deprecate the `:tokenizer` option to `validates_length_of`Sean Griffin2015-03-293-12/+51
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As demonstrated by #19570, this option is severely limited, and satisfies an extremely specific use case. Realistically, there's not much reason for this option to exist. Its functionality can be trivially replicated with a normal Ruby method. Let's deprecate this option, in favor of the simpler solution.
* / / / / / / Clarify the role of `ActiveRecord::Core.encode_with`Sean Griffin2015-03-291-4/+8
|/ / / / / / | | | | | | | | | | | | | | | | | | Fixes #19568
* | | | | | Reduce memory usage when loading types in PGSean Griffin2015-03-294-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were never clearing the `PG::Result` object used to query the types when the connection is first established. This would lead to a potentially large amount of memory being retained for the life of the connection. Investigating this issue also revealed several low hanging fruit on the performance of these methods, and the number of allocations has been reduced by ~90%. Fixes #19578
* | | | | | Merge pull request #19483 from yui-knk/fix/getting_startedZachary Scott2015-03-291-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | [ci skip] Fix an object of `reference`
| * | | | | | [ci skip] Fix an object of `reference`yui-knk2015-03-241-1/+1
| | | | | | |
* | | | | | | Merge pull request #19575 from y-yagi/fix_batches_testZachary Scott2015-03-291-2/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | use correct method in batches test
| * | | | | | | use correct method in batches testyuuji.yaginuma2015-03-291-2/+3
|/ / / / / / /
* | | | | | | Merge pull request #19544 from shuhei/fix-parameters-const-missingXavier Noria2015-03-282-2/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Return super in ActionController::Parameters.const_missing
| * | | | | | | Return super in ActionController::Parameters.const_missingShuhei Kagawa2015-03-282-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of ActionController::Parameters.const_missing returns `ActionController::Parameters.always_permitted_parameters` even if its `super` returns a constant without raising error. This prevents its subclass in a autoloading module/class from taking advantage of autoloading constants. class SomeParameters < ActionController::Parameters def do_something DefinedSomewhere.do_something end end In the code above, `DefinedSomewhere` is to be autoloaded with `Module.const_missing` but `ActionController::Parameters.const_missing` returns `always_permitted_parameters` instead of the autoloaded constant. This pull request fixes the issue respecting `const_missing`'s `super`.
* | | | | | | | Remove circular requireRafael Mendonça França2015-03-272-4/+0
| | | | | | | |
* | | | | | | | Merge pull request #19562 from mechanicles/remove-old-linkRafael Mendonça França2015-03-271-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove old and not working link. [ci skip]
| * | | | | | | | Remove old and not working link. [ci skip]Santosh Wadghule2015-03-281-1/+1
| | | | | | | | |
* | | | | | | | | Define a setup method instead of using setup as blockRafael Mendonça França2015-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setup as block run before setup actlually runs so it will fail for our case
* | | | | | | | | Remove Array#inquiryRafael Mendonça França2015-03-274-27/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are promoting too much a feature that will not be widler used. So for now lets keep just the ArrayInquirer constructor.
* | | | | | | | | Merge pull request #18939 from georgeclaghorn/variant-inquiryRafael Mendonça França2015-03-2710-33/+171
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | | | | | | | | | | Provide friendlier access to request variants
| * | | | | | | | Add ActiveSupport::ArrayInquirer and Array#inquiryGeorge Claghorn2015-03-247-27/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its string-like contents. For example, `request.variant` returns an `ArrayInquirer` object. To check a request's variants, you can call: request.variant.phone? request.variant.any?(:phone, :tablet) ...instead of: request.variant.include?(:phone) request.variant.any? { |v| v.in?([:phone, :tablet]) } `Array#inquiry` is a shortcut for wrapping the receiving array in an `ArrayInquirer`: pets = [:cat, :dog] pets.cat? # => true pets.ferret? # => false pets.any?(:cat, :ferret} # => true
| * | | | | | | | Provide friendlier access to request variantsGeorge Claghorn2015-03-244-37/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #18933.