aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
Commit message (Collapse)AuthorAgeFilesLines
* backport #8403, no intermediate AR objects when eager loading.Yves Senn2012-12-041-2/+4
| | | | | | | | | Closes #3313 Conflicts: activerecord/CHANGELOG.md activerecord/test/models/developer.rb
* Merge pull request #4942 from bogdan/pluck_joinsJosé Valim2012-12-031-1/+6
| | | | | | | | AR::Relation#pluck: improve to work with joins Conflicts: activerecord/lib/active_record/relation/calculations.rb activerecord/test/cases/calculations_test.rb
* handled respond_to? with private methodsSHIBATA Hiroshi2012-12-031-1/+1
|
* Merge pull request #6397 from kennyj/fix_translate_exceptionAaron Patterson2012-11-301-3/+7
| | | | Fix a problem of translate_exception method in a Japanese (non English) environment.
* Backport 78b30fed9336336694fb2cb5d2825f95800b541c to fix non-utf-8 databases ↵Jeremy Kemper2012-11-291-5/+19
| | | | mistakenly getting utf8 collation
* Merge pull request #7689 from cbarton/assume_migration_version_with_prefix_fixAaron Patterson2012-11-281-1/+1
|\ | | | | Fixing a schema:load when using a prefix and suffix on the tables [Reopen/backport]
| * Making test accurately reflect what is going on in the schema migrations testChris Barton2012-09-181-1/+1
| |
* | Work around undiagnosed bug that's draining a relation's bind_valuesJeremy Kemper2012-11-281-0/+1
| |
* | schema cache already has the columns as a hash, so use thatAaron Patterson2012-11-261-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commits 978ec98c8eff824a60c7e973f369cc7bed1f4d36 and 51676652a3568ad09b06385564de4fdcb13af05e changed database statements to use the schema_cache methods, added on master in c99e34e90d763c52cbe8dc3d950ed1b4db665dc4 and dc973e78560a6514ab172f0ee86dc84a9147d39a But apparently the methods weren't added to schema_cache, resulting in the failure described in #8322 for 3-2-stable. Fixes #8322. Conflicts: activerecord/lib/active_record/connection_adapters/schema_cache.rb
* | schema cache already has the columns as a hash, so use thatAaron Patterson2012-11-251-1/+1
| |
* | speed up fixture loading by querying the schema cache for column namesAaron Patterson2012-11-251-1/+1
| |
* | Merge pull request #8311 from alisdair/dirty-nullable-datetimeCarlos Antonio da Silva2012-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | Don't call will_change! for datetime nil->"". Setting a nil datetime attribute to a blank string should not cause the attribute to be dirty. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
* | backport #8291, prevent mass assignment of polymorphic type with `build`Yves Senn2012-11-221-1/+2
| | | | | | | | | | | | | | | | | | Closes #8265 Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/associations/association.rb
* | Merge pull request #8276 from pwnall/pgsql_text_limitsRafael Mendonça França2012-11-201-0/+7
| | | | | | | | | | | | | | Postgresql doesn't accepts limits on text columns Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
* | Be a bit less conservative with mysql in adapterCarlos Antonio da Silva2012-11-191-1/+1
| | | | | | | | This will allow the new mysql 2.9.0 to be used, fixing our test issues.
* | Merge pull request #7983 from georgebrock/bug7950-squashedCarlos Antonio da Silva2012-11-166-12/+35
|\ \ | | | | | | | | | | | | | | | | | | | | | Backport 4bc2ae0 to fix #7950 Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/calculations.rb
| * | use bind values for join columnsAaron Patterson2012-11-106-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport of 4bc2ae0da1dd812aee759f6d13ad428354cd0e13. It fixes bug #7950. Conflicts: activerecord/lib/active_record/relation/calculations.rb activerecord/lib/active_record/relation/finder_methods.rb
* | | Merge pull request #8209 from senny/backport_8176Rafael Mendonça França2012-11-131-1/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | backport #8176, `#pluck` can be used on a relation with `select` clause. Conflicts: activerecord/CHANGELOG.md
| * | | backport #8176, `#pluck` can be used on a relation with `select` clause.Yves Senn2012-11-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/calculations.rb activerecord/test/cases/calculations_test.rb
* | | | Merge pull request #8204 from nikitug/fix_dynamic_finder_result_checkRafael Mendonça França2012-11-131-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use nil? instead of blank? to check dynamic finder result Conflicts: activerecord/CHANGELOG.md
| * | | | Use nil? instead of blank? to check dynamic finder resultNikita Afanasenko2012-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's safe to use `nil?` instead of `blank?` because it's impossible to get an array on finder with bang; `all_by` finder matches against regex without bang: `when /^find_(all_|last_)?by_([_a-zA-Z]\w*)$/`. Fixes #7238
* | | | | Fix deleting from a HABTM join table upon destroying an object of a model ↵Nick Rogers2012-11-131-0/+2
|/ / / / | | | | | | | | | | | | with optimistic locking enabled. Fixes #5332.
* / / / Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only ↵kennyj2012-11-141-6/+6
|/ / / | | | | | | | | | database.yml but also DATABASE_URL.
* | | Merge pull request #8154 from bogdan/has_one_association_performanceCarlos Antonio da Silva2012-11-121-1/+9
| | | | | | | | | | | | | | | | | | | | | Remove unwanted transaction when has one association is built Conflicts: activerecord/CHANGELOG.md
* | | Merge branch '3-2-9' into 3-2-stableSantiago Pastorino2012-11-121-1/+1
|\ \ \ | |/ / |/| |
| * | Bump to 3.2.9Santiago Pastorino2012-11-121-1/+1
| | |
* | | Merge branch '3-2-9' into 3-2-stableSantiago Pastorino2012-11-091-1/+1
|\| |
| * | Bump up to 3.2.9.rc3Santiago Pastorino2012-11-091-1/+1
| | |
* | | Backport #8078: Fix `attributes_before_type_cast` for serialised attributes.Nikita Afanasenko2012-11-091-0/+10
| | | | | | | | | | | | Public method attributes_before_type_cast used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like read_attribute_before_type_cast and returns unserialised values.
* | | Merge pull request #7987 from ↵Santiago Pastorino2012-11-081-2/+2
|\ \ \ | | | | | | | | | | | | | | | | alexisbernard/3-2_find_in_batches_compatible_with_strings Fix find_in_batches with customized primary_key on 3-2-stable
| * | | Fix find_in_batches against string IDs when start option is not specified.Alexis Bernard2012-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/batches.rb
| * | | start could be a stringSantiago Pastorino2012-11-081-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Related to 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 and eb876c4d07130f15be2cac7be968cc393f959c62 Conflicts: activerecord/lib/active_record/relation/batches.rb activerecord/test/cases/batches_test.rb
* / / Fix accepts_nested_attributes for child classesGabriel Sobrinho & Ricardo Henrique2012-11-071-3/+4
|/ / | | | | | | Closes GH-8131
* | Bump to 3.2.9.rc2Santiago Pastorino2012-11-011-1/+1
| |
* | Ensure calling first/last with options correctly set inverse associationCarlos Antonio da Silva2012-11-011-1/+3
| | | | | | | | Also related to #8087. Thanks @al2o3cr.
* | Fix issue with collection associations and first(n)/last(n)Carlos Antonio da Silva2012-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling first(n) or last(n) in a collection, Active Record was improperly trying to set the inverse of instance in case that option existed. This change was introduced by fdf4eae506fa9895e831f569bed3c4aa6a999a22. In such cases we don't need to do that "manually", since the way collection will be loaded will already handle that, so we just skip setting the inverse association when any argument is given to first(n)/last(n). The test included ensures that these scenarios will have the inverse of instance set properly. Fixes #8087, Closes #8094.
* | Fix ActiveRecord#update_column return valuesaksmlz2012-10-311-1/+1
| |
* | Fix typo :bomb: [ci skip]Rafael Mendonça França2012-10-291-1/+1
| |
* | Fix bug when Column is trying to type cast boolean values to integer.Rafael Mendonça França2012-10-291-2/+13
| | | | | | | | | | | | | | | | This can occur if the user is using :integer columns to store boolean values. Now we are handling the boolean values but it still raises if the value can't type cast to integer and is not a boolean. See #7509. Fixes #8067.
* | Merge pull request #8009 from graceliu/3-2-fix_database_url_supportRafael Mendonça França2012-10-292-35/+55
|\ \ | | | | | | | | | fixed support for DATABASE_URL for rake db tasks
| * | fixed support for DATABASE_URL for rake db tasksGrace Liu2012-10-292-35/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport for #7521 - added tests to confirm establish_connection uses DATABASE_URL and Rails.env correctly even when no arguments are passed in. - updated rake db tasks to support DATABASE_URL, and added tests to confirm correct behavior for these rake tasks. (Removed establish_connection call from some tasks since in those cases the :environment task already made sure the function would be called) - updated Resolver so that when it resolves the database url, it removes hash values with empty strings from the config spec (e.g. to support connection to postgresql when no username is specified). - updated ResolverTest to use current_adapter? to check the type of the current adapter.
* | | Bump to 3.2.9.rc1Santiago Pastorino2012-10-291-2/+2
|/ /
* | Merge pull request #8057 from frodsan/fix_sqlite_mutate_argRafael Mendonça França2012-10-291-1/+1
| | | | | | | | | | | | SQLite3Adapter#type_cast should not mutate arguments Conflicts: activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
* | Merge pull request #8053 from henrik/update_columns_with_primary_keyCarlos Antonio da Silva2012-10-291-1/+5
| | | | | | | | | | | | | | | | Unbreak update_column/update_columns for the primary key attribute. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/persistence.rb activerecord/test/cases/persistence_test.rb
* | Make Active Record tests pass in isolationRafael Mendonça França2012-10-291-2/+1
| | | | | | | | Also remove the feature detecting for Ruby 1.9
* | Merge pull request #7593 from veader/patch-1Rafael Mendonça França2012-10-281-0/+2
| | | | | | | | | | | | | | Decode attributes pulled from URI.parse Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/connection_specification.rb
* | frozen state should be restored after txn is abortedAaron Patterson2012-10-221-2/+3
| |
* | Use `Rails.env` instead of `ENV['RAILS_ENV']`; #7951Martin Grandrath2012-10-181-1/+1
| | | | | | | | | | | | | | `ENV['RAILS_ENV']` is not defined unless explicitly specified on the command line when running `rake db:structure:load`. This patch lets the rake task retrieve the environment from `Rails.env` which defaults to "development".
* | Merge pull request #7371 from csmuc/fix_dup_validation_errorsSantiago Pastorino2012-10-171-0/+1
| | | | | | | | | | | | | | Dup'ed ActiveRecord objects may not share the errors object Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/dup_test.rb
* | Synchronize around deleting from the reserved connections hash.Aaron Patterson2012-10-151-1/+1
| | | | | | | | Fixes #7955