| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
|
| |
| |
| |
| | |
code docs
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Fix has_many assocation w/select load after create
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If you create a new record via a collection association proxy that has
not loaded its target, and which selects additional attributes through
the association, then when the proxy loads its target, it will
inadvertently trigger an ActiveModel::MissingAttributeError during
attribute writing when CollectionAssociation#merge_target_lists attempts
to do its thing, since the newly loaded records will possess attributes
the created record does not.
This error also raises a bogus/confusing deprecation warning when
accessing the association in Rails 3.2.x, so cherry-pick would be
appreciated!
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit abf8de85519141496a6773310964ec03f6106f3f.
We should take a deeper look to those cases flat_map doesn't do deep
flattening.
irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten
=> [1, 3, 1, 2]
irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i}
=> [[1, 3], [1, 2]]
|
| | | |
|
| | |
| | |
| | |
| | | |
this method was not used, not documented and not tested.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Rename `ActiveRecord::Fixtures` class to `ActiveRecord::FixtureSet`. Instances of this class normally hold a collection of fixtures (records) loaded either from a single YAML file, or from a file and a folder with the same name. This change make the class name singular and makes the class easier to distinguish from the modules like `ActiveRecord::TestFixtures`, which operates on multiple fixture sets, or `DelegatingFixtures`, `::Fixtures`, etc., and from the class `ActiveRecord::Fixture`, which corresponds to a single fixture.
|
|/ / |
|
| |
| |
| | |
- Changed the comments documentation for the update_column(s) methods to add a little bit of clarity
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Patches `CollectionAssociation#count` to return 0 without querying
if the parent record is new. Consider the following code:
class Account
has_many :dossiers
end
class Dossier
belongs_to :account
end
a = Account.new
a.dossiers.build
# before patch
a.dossiers.count
# SELECT COUNT(*) FROM "dossiers" WHERE "dossiers"."account_id" IS NULL
# => 0
# after
a.dosiers.count # fires without sql query
# => 0
Fixes #1856.
|
| | |
|
|\ \
| | |
| | | |
Fix reset_counters crashing on has_many :through associations.
|
| | |
| | |
| | |
| | |
| | | |
The counter column name in the intermediate model need to be access
via the through reflection.
|
|\ \ \
| |/ /
|/| | |
Optimize log subscribers to check if the log level is sufficient
|
| | |
| | |
| | |
| | | |
performing an operations.
|
| | |
| | |
| | |
| | |
| | | |
reflection init as 'if' stantment.
column is always the same expression and depends from the changing of attributes
|
| |/
|/| |
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
actionpack/lib/action_view/helpers/asset_tag_helper.rb
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When inserting new records, only the fields which have been changed
from the defaults will actually be included in the INSERT statement.
The other fields will be populated by the database.
This is more efficient, and also means that it will be safe to
remove database columns without getting subsequent errors in running
app processes (so long as the code in those processes doesn't
contain any references to the removed column).
|
| | | |
|
| | |
| | |
| | |
| | | |
65843e1acc0c8d285ff79f8c9c49d4d1215440be
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Related to 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 and
eb876c4d07130f15be2cac7be968cc393f959c62
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 761bc751d31c22e2c2fdae2b4cdd435b68b6d783.
This commit wasn't fixing any issue just using the same table for
different models with different primary keys.
|
|/ / |
|
| |
| |
| |
| | |
set utf8_unicode_ci collation on latin1 table.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
actionmailer/lib/action_mailer/base.rb
activesupport/lib/active_support/configurable.rb
activesupport/lib/active_support/core_ext/module/deprecation.rb
guides/source/action_controller_overview.md
guides/source/active_support_core_extensions.md
guides/source/ajax_on_rails.textile
guides/source/association_basics.textile
guides/source/upgrading_ruby_on_rails.md
While resolving conflicts, I have chosen to ignore changes done in
docrails at some places - these will be most likely 1.9 hash syntax
changes.
|
| | |
| | |
| | |
| | | |
Callbacks may interfere with each other.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Fixes #3458.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If your database supports setting the isolation level for a transaction,
you can set it like so:
Post.transaction(isolation: :serializable) do
# ...
end
Valid isolation levels are:
* `:read_uncommitted`
* `:read_committed`
* `:repeatable_read`
* `:serializable`
You should consult the documentation for your database to understand the
semantics of these different levels:
* http://www.postgresql.org/docs/9.1/static/transaction-iso.html
* https://dev.mysql.com/doc/refman/5.0/en/set-transaction.html
An `ActiveRecord::TransactionIsolationError` will be raised if:
* The adapter does not support setting the isolation level
* You are joining an existing open transaction
* You are creating a nested (savepoint) transaction
The mysql, mysql2 and postgresql adapters support setting the
transaction isolation level. However, support is disabled for mysql
versions below 5, because they are affected by a bug
(http://bugs.mysql.com/bug.php?id=39170) which means the isolation level
gets persisted outside the transaction.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
jcoleman/should-unset-association-when-an-existing-record-is-destroyed
Unset association when existing record is destroyed.
|