aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fix missing typewriter tagLincoln Lee2012-10-081-1/+1
| |
| * Add CollectionAssociation#destroy to ActiveRecord::Association::ClassMethods ↵Samuel Cochran2012-10-051-3/+15
| | | | | | | | code docs
| * fix example in Migration docs [ci skip]Francesco Rodriguez2012-09-301-1/+1
| |
| * add change_table transformation to Migration docs [ci skip]Francesco Rodriguez2012-09-301-16/+19
| |
* | Merge pull request #7859 from ernie/fix-collection-associations-with-selectAaron Patterson2012-10-091-1/+1
|\ \ | | | | | | Fix has_many assocation w/select load after create
| * | Fix has_many assocation w/select load after createErnie Miller2012-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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!
| * | Revert "Use flat_map { } instead of map {}.flatten"Santiago Pastorino2012-10-056-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]]
| * | Use flat_map { } instead of map {}.flattenSantiago Pastorino2012-10-056-9/+9
| | |
* | | remove unused `expand_range_bind_variables` methodYves Senn2012-10-081-17/+0
| | | | | | | | | | | | this method was not used, not documented and not tested.
* | | Should use app.paths instead of specific path.kennyj2012-10-081-1/+2
| | |
* | | Move/rename files to follow naming conventionsAlexey Muranov2012-10-072-1/+1
| | |
* | | Deprecate "Fixtures" constantAlexey Muranov2012-10-071-0/+8
| | |
* | | Rename "Fixtures" class to "FixtureSet"Alexey Muranov2012-10-073-21/+21
| | | | | | | | | | | | 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.
* | | PostgreSQL, quote table names when fetching the primary key. Closes #5920Yves Senn2012-10-051-1/+1
|/ /
* | Update activerecord/lib/active_record/persistence.rbAdam Haymond2012-10-041-2/+2
| | | | | | - Changed the comments documentation for the update_column(s) methods to add a little bit of clarity
* | Count returns 0 without querying if parent is not savedFrancesco Rodriguez2012-10-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | RefactorSantiago Pastorino2012-10-031-5/+4
| |
* | Merge pull request #7822 from lulalala/reset-counter-cache-for-has-many-throughRafael Mendonça França2012-10-021-2/+7
|\ \ | | | | | | Fix reset_counters crashing on has_many :through associations.
| * | Fix reset_counters() crashing on has_many :through associations.lulalala2012-10-021-2/+7
| | | | | | | | | | | | | | | The counter column name in the intermediate model need to be access via the through reflection.
* | | Merge pull request #7708 from bdurand/optimize_log_subscribersRafael Mendonça França2012-10-011-4/+6
|\ \ \ | |/ / |/| | Optimize log subscribers to check if the log level is sufficient
| * | Optimize log subscribers to check if the log level is sufficient before ↵Brian Durand2012-09-301-4/+6
| | | | | | | | | | | | performing an operations.
* | | small refactoring of build_relation in uniquenessAngelo Capilleri2012-09-291-5/+3
| | | | | | | | | | | | | | | reflection init as 'if' stantment. column is always the same expression and depends from the changing of attributes
* | | Fix syntax error with no US-ASCII charRafael Mendonça França2012-09-281-1/+1
| |/ |/|
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-09-2817-186/+161
|\ \ | | | | | | | | | | | | Conflicts: actionpack/lib/action_view/helpers/asset_tag_helper.rb
| * | remove added indentation from the last commit [ci skip]Francesco Rodriguez2012-09-221-1/+1
| | |
| * | update AR::Validations documentation [ci skip]Francesco Rodriguez2012-09-225-28/+28
| | |
| * | nodoc AR::Railtie [ci skip]Francesco Rodriguez2012-09-212-4/+4
| | |
| * | update AR::Scoping documentation [ci skip]Francesco Rodriguez2012-09-212-91/+77
| | |
| * | add :nodoc: directive to AR::Fixtures::File [ci skip]Francesco Rodriguez2012-09-211-1/+1
| | |
| * | fix AR::Coders::YAMLColumn nodoc [ci skip]Francesco Rodriguez2012-09-211-4/+2
| | |
| * | update AR/attribute_methods documentation [ci skip]Francesco Rodriguez2012-09-214-26/+36
| | |
| * | Better docs for overriding inheretance columnSteve Klabnik2012-09-221-5/+2
| | |
| * | fix AR::AttributeMethods::Dirty :nodoc: [ci skip]Francesco Rodriguez2012-09-211-4/+4
| | |
| * | fix AR::Associations::CollectionProxy#delete broken documentation [ci skip]Francesco Rodriguez2012-09-211-23/+2
| | |
| * | update AR::Associations::CollectionProxy#loaded? documentation [ci skip]Francesco Rodriguez2012-09-211-1/+6
| | |
* | | Support for partial inserts.Jon Leighton2012-09-287-15/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Removing dead code. attribute_cast_code is not called.kennyj2012-09-282-25/+0
| | |
* | | Fix destructive side effects from marshaling an association caused by ↵Jeremy Kemper2012-09-251-5/+2
| | | | | | | | | | | | 65843e1acc0c8d285ff79f8c9c49d4d1215440be
* | | make clear that expired db/schema_cache.dump are ignoredXavier Noria2012-09-241-1/+1
| | |
* | | start could be a stringSantiago Pastorino2012-09-211-1/+1
| | | | | | | | | | | | | | | Related to 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 and eb876c4d07130f15be2cac7be968cc393f959c62
* | | Revert "Fix find_in_batches with customized primary_key"Santiago Pastorino2012-09-211-7/+6
| | | | | | | | | | | | | | | | | | | | | This reverts commit 761bc751d31c22e2c2fdae2b4cdd435b68b6d783. This commit wasn't fixing any issue just using the same table for different models with different primary keys.
* | | Correct default charset/collation for mysql dbsJeremy Kemper2012-09-211-6/+9
|/ /
* | Use default charset/collation only if *neither* is specified. Otherwise we ↵Jeremy Kemper2012-09-211-4/+7
| | | | | | | | set utf8_unicode_ci collation on latin1 table.
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-09-212-8/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Add extra note about :dependent => :destroy.Steve Klabnik2012-09-211-1/+4
| | | | | | | | | | | | Callbacks may interfere with each other.
| * | fix :nodoc:s in AR::Timestamp [ci skip]Francesco Rodriguez2012-09-191-7/+7
| | |
| * | Doc typo: depenent -> dependent; trailing ws.Henrik N2012-09-161-2/+2
| | |
| * | Improve documentation about :dependent and callbacks.Steve Klabnik2012-09-151-0/+5
| | | | | | | | | | | | Fixes #3458.
* | | Support for specifying transaction isolation levelJon Leighton2012-09-217-15/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #5248 from ↵Jon Leighton2012-09-211-0/+1
|\ \ \ | | | | | | | | | | | | | | | | jcoleman/should-unset-association-when-an-existing-record-is-destroyed Unset association when existing record is destroyed.