- 06 5月, 2013 1 次提交
-
-
由 Daniel Schierbeck 提交于
Add a simple API for fetching a list of entries from the cache, where any missing entries are computed by a supplied block.
-
- 03 5月, 2013 13 次提交
-
-
由 Jon Leighton 提交于
autosave_association issue that occurs when table has unique index (resubmission)
-
由 Carlos Antonio da Silva 提交于
Use faster Array.new instead of []*padding
-
由 Jon Leighton 提交于
This reverts commit 09751fdc, reversing changes made to 6a5ab08d. This change caused a failure in actionpack/test/abstract/callbacks_test.rb.
-
由 Jon Leighton 提交于
MiniTest 4.7.3 detects the presence of SIGINFO and stores the answer in a constant. It seems that MiniTest 4.7.4 changes this, and instead relies on an info_signal method being implemented on the runner object. In ActiveSupport::Testing::Isolation, we use ProxyTestResult to stand in for the runner object. This object implements `method_missing`, and as such its #info_signal method has a truthy return value. This results in MiniTest trying to install the SIGINFO handler on platforms where SIGINFO does not exists. To fix, I am simply defining an explicit ProxyTestResult#info_signal method.
-
由 Jon Leighton 提交于
test_mysql_integer_not_null_defaults in test/cases/defaults_test.rb was failing. This test relies on the connection being in strict mode. By default a new connection is not in strict mode, but Active Record automatically places it in strict mode. ActiveSchemaTest overwrites the connection's #execute method in order to prevent SQL statements from actually being executed. One of the operations which is performed in ActiveSchema test is a #recreate_database. Since 2088bf27, recreate_database on mysql or mysql2 will trigger a reconnect. Due to the implementation of the hacking of #execute in ActiveSchemaTest, this reconnect would take place, but the connection would *not* be placed in strict mode because #execute had been overridden to prevent SQL queries hitting the database. Therefore, after ActiveSchemaTest, the connection would no longer be in strict mode, causing test_mysql_integer_not_null_defaults to fail. I don't think that the way that ActiveSchemaTest is implemented is particularly nice or clean, but I have taken steps to make its hacks more isolated - it now create a separate connection object which is thrown away after the test, and the hacks are applied on the singleton class of this object.
-
由 Rafael Mendonça França 提交于
Restore ActiveRecord connection to original environment after rake:db:test:prepare task.
-
由 Rafael Mendonça França 提交于
Improving the performance of callbacks
-
由 wangjohn 提交于
callbacks in the CallbackChain, so you don't have to iterate over all callbacks when checking for duplicates. Benchmark results when the tests in activerecord/test/cases/associations_test.rb were run with and without the change: == On master (when scanning all of the callbacks): --------------------------------------------------------- % cumulative self self total time seconds seconds calls ms/call ms/call name --------------------------------------------------------- 1.85 9.26 0.82 18412 0.04 0.05 ActiveSupport::Callbacks::Callback#matches? 1.22 12.32 0.54 18412 0.03 0.08 ActiveSupport::Callbacks::Callback#duplicates? 0.93 14.61 0.41 19600 0.02 0.21 ActiveSupport::Callbacks::CallbackChain#remove_duplicates Finished tests in 1.217065s, 30.4010 tests/s, 53.4072 assertions/s. --------------------------------------------------------- == On my branch (when using a hash to check callback duplication): --------------------------------------------------------- % cumulative self self total time seconds seconds calls ms/call ms/call name --------------------------------------------------------- 0.15 29.63 0.06 1188 0.05 0.72 ActiveSupport::Callbacks::CallbackChain#handle_duplicates 0.00 40.50 0.00 84 0.00 0.12 ActiveSupport::Callbacks::Callback#matches? 0.00 40.50 0.00 84 0.00 0.12 ActiveSupport::Callbacks::Callback#duplicates? 0.00 40.50 0.00 91 0.00 0.22 ActiveSupport::Callbacks::CallbackChain#scan_and_remove_duplicates Finished tests in 1.117757s, 33.1020 tests/s, 58.1522 assertions/s. ---------------------------------------------------------
-
由 Rafael Mendonça França 提交于
Add parameter :sslcompression to PostgreSQL adapter.
-
由 Lars Kanis 提交于
It is new in PostgreSQL-9.2 .
-
由 Carlos Antonio da Silva 提交于
Add styling to h1 for default rescue layout
-
由 Rafael Mendonça França 提交于
Refactoring the creation of TestTasks to remove code duplication.
-
由 Tim Krajcar 提交于
-
- 02 5月, 2013 26 次提交
-
-
由 wangjohn 提交于
-
由 markevich 提交于
-
由 Carlos Antonio da Silva 提交于
Add test for `AR::Base#to_param`
-
由 Takehiro Adachi 提交于
According to the doc of `AR::Base#to_param`( https://github.com/rails/rails/blob/04cda1848cb847c2bdad0bfc12160dc8d554 7775/activerecord/lib/active_record/integration.rb#L18 ), it returns `nil` if the record is not persisted.
-
由 Carlos Antonio da Silva 提交于
Fix typo in test
-
由 Xavier Noria 提交于
Fixes Dependency bug in Active Support
-
由 Johnny Holton 提交于
fixes bug introduced by #3329 These are the conditions necessary to reproduce the bug: - For an association, autosave => true. - An association record is being destroyed - A new association record is being created. - There is a unique index one of the association's fields. - The record being created has the same value as the record being destroyed on the indexed field. Before, the deletion of records was postponed until after all insertions/saves. Therefore the new record with the identical value in the indexed field caused a non-unique value error to be thrown at the database level. With this fix, the deletions happen first, before the insertions/saves. Therefore the record with the duplicate value is gone from the database before the new record is created, thereby avoiding the non-uniuqe value error.
-
由 Tomohiko Himura 提交于
DateTime defined in date.rb
-
由 Vipul A M 提交于
-
由 Vipul A M 提交于
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
Extract tests code out from AR's base_test.rb to integration_test.rb
-
由 Takehiro Adachi 提交于
`AR::Base#to_param` and `AR::Base#cache_key` is defined at active_record/integration.rb, so tests for those methods should be at integration_test.rb
-
由 Rafael Mendonça França 提交于
Convert ActiveModel to 1.9 hash syntax.
-
由 Patrick Robertson 提交于
I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
-
由 Aaron Patterson 提交于
Handle aliased attributes in AR::Relation
-
由 Carlos Antonio da Silva 提交于
Introduced in 09ac1776.
-
由 Carlos Antonio da Silva 提交于
Use constant for encoding
-
由 Nihad Abbasov 提交于
-
由 Godfrey Chan 提交于
When using symbol keys, ActiveRecord will now translate aliased attribute names to the actual column name used in the database: With the model class Topic alias_attribute :heading, :title end The call Topic.where(heading: 'The First Topic') should yield the same result as Topic.where(title: 'The First Topic') This also applies to ActiveRecord::Relation::Calculations calls such as `Model.sum(:aliased)` and `Model.pluck(:aliased)`. This will not work with SQL fragment strings like `Model.sum('DISTINCT aliased')`. Github #7839 *Godfrey Chan*
-
由 Rafael Mendonça França 提交于
Allow override of PostgreSQL UUID primary key default
-
由 Chad Moone 提交于
without this, it's not possible to use UUID primary keys without uuid-ossp installed and activated
-
由 Guillermo Iguaran 提交于
Make railties version match RAILS_VERSION
-
由 Sam Ruby 提交于
-
由 Guillermo Iguaran 提交于
Remove varargs from `Object#in?`
-