aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/CHANGELOG.md
Commit message (Collapse)AuthorAgeFilesLines
...
* | Add CHANGELOG entry for #6376.Rafael Mendonça França2012-12-101-0/+4
| |
* | Allow users to choose the timestamp format in the cache keyRafael Mendonça França2012-12-101-0/+7
| | | | | | | | | | | | This can be done using the class attribute cache_timestamp_format Closes #8195
* | Unscope update_column(s) query to ignore default scopeCarlos Antonio da Silva2012-12-061-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When applying default_scope to a class with a where clause, using update_column(s) could generate a query that would not properly update the record due to the where clause from the default_scope being applied to the update query. class User < ActiveRecord::Base default_scope where(active: true) end user = User.first user.active = false user.save! user.update_column(:active, true) # => false In this situation we want to skip the default_scope clause and just update the record based on the primary key. With this change: user.update_column(:active, true) # => true Backport of #8436 fix. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/persistence.rb activerecord/test/cases/persistence_test.rb
* | Merge pull request #8417 from kennyj/fix_8414Rafael Mendonça França2012-12-041-0/+6
| | | | | | | | | | | | Fix #8414. Performance problem with postgresql adapter primary_key function. Conflicts: activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
* | backport #8403, no intermediate AR objects when eager loading.Yves Senn2012-12-041-0/+7
| | | | | | | | | | | | | | | | | | Closes #3313 Conflicts: activerecord/CHANGELOG.md activerecord/test/models/developer.rb
* | Merge pull request #4942 from bogdan/pluck_joinsJosé Valim2012-12-031-0/+4
| | | | | | | | | | | | | | | | AR::Relation#pluck: improve to work with joins Conflicts: activerecord/lib/active_record/relation/calculations.rb activerecord/test/cases/calculations_test.rb
* | Make the CHANGELOG consistent [ci skip]Rafael Mendonça França2012-11-301-11/+20
| |
* | Merge pull request #6397 from kennyj/fix_translate_exceptionAaron Patterson2012-11-301-0/+5
| | | | | | | | Fix a problem of translate_exception method in a Japanese (non English) environment.
* | Merge pull request #8311 from alisdair/dirty-nullable-datetimeCarlos Antonio da Silva2012-11-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | 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-0/+5
| | | | | | | | | | | | | | | | | | 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/+5
| | | | | | | | | | | | | | Postgresql doesn't accepts limits on text columns Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
* | Merge pull request #7983 from georgebrock/bug7950-squashedCarlos Antonio da Silva2012-11-161-0/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | Backport 4bc2ae0 to fix #7950 Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/calculations.rb
| * | Test/changelog for has_many bug on unsaved recordsGeorge Brocklehurst2012-11-101-0/+6
| | | | | | | | | | | | | | | | | | | | | See issue #7950. The previous commit fixes this bug, and is a backport of 4bc2ae0da1dd812aee759f6d13ad428354cd0e13.
* | | Merge pull request #8209 from senny/backport_8176Rafael Mendonça França2012-11-131-0/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+9
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+4
|/ / / / | | | | | | | | | | | | with optimistic locking enabled. Fixes #5332.
* / / / Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only ↵kennyj2012-11-141-0/+5
|/ / / | | | | | | | | | database.yml but also DATABASE_URL.
* | | Add release date of Rails 3.2.9 to documentationclaudiob2012-11-121-1/+1
| | |
* | | Merge pull request #8154 from bogdan/has_one_association_performanceCarlos Antonio da Silva2012-11-121-0/+9
|/ / | | | | | | | | | | | | Remove unwanted transaction when has one association is built Conflicts: activerecord/CHANGELOG.md
* | Backport #8078: Fix `attributes_before_type_cast` for serialised attributes.Nikita Afanasenko2012-11-091-0/+4
| | | | | | | | 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-0/+4
|\ \ | | | | | | | | | | | | 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-0/+4
| |/ | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/batches.rb
* | Fix the release in the CHANGELOG [ci skip]Rafael Mendonça França2012-11-081-1/+4
| |
* | Fix accepts_nested_attributes for child classesGabriel Sobrinho & Ricardo Henrique2012-11-071-0/+26
|/ | | | Closes GH-8131
* Fix issue with collection associations and first(n)/last(n)Carlos Antonio da Silva2012-11-011-2/+7
| | | | | | | | | | | | | | | | | 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.
* Add CHANGELOG entry to #8032 fixRafael Mendonça França2012-10-291-0/+5
| | | | | | e6b41845efe2252fe7de6882e355c31f93c65cc3 fixes that issue too. [ci skip]
* Fix bug when Column is trying to type cast boolean values to integer.Rafael Mendonça França2012-10-291-0/+5
| | | | | | | | 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.
* fixed support for DATABASE_URL for rake db tasksGrace Liu2012-10-291-0/+2
| | | | | | | | | | | | | | | | 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.
* Merge pull request #8053 from henrik/update_columns_with_primary_keyCarlos Antonio da Silva2012-10-291-0/+4
| | | | | | | | 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
* Merge pull request #7593 from veader/patch-1Rafael Mendonça França2012-10-281-0/+4
| | | | | | | Decode attributes pulled from URI.parse Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/connection_specification.rb
* Merge pull request #7371 from csmuc/fix_dup_validation_errorsSantiago Pastorino2012-10-171-0/+5
| | | | | | | 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-0/+3
| | | | Fixes #7955
* #7914 get default value when type uses schema nameArturo Pie2012-10-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL adapter properly parses default values when using multiple schemas and domains. When using domains across schemas, PostgresSQL prefixes the type of the default value with the name of the schema where that type (or domain) is. For example, this query: ``` SELECT a.attname, d.adsrc FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = "defaults"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum; ``` could return something like "'<default_value>'::pg_catalog.text" or "(''<default_value>'::pg_catalog.text)::text" for the text columns with defaults. I modified the regexp used to parse this value so that it ignores anything between ':: and \b(?:character varying|bpchar|text), and it allows to have optional parens like in the above second example.
* Fix has_many assocation w/select load after createErnie Miller2012-10-121-0/+6
| | | | | | | | | | 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 a deprecation notice 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.
* Merge pull request #7850 from ↵Rafael Mendonça França2012-10-061-4/+9
| | | | | | | | | senny/5920_postgres_adapter_table_with_capital_letters postgres, quote table names when fetching the primary key (#5920) Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
* Merge pull request #6978 from frodsan/count_nosql_unsaved_parentRafael Mendonça França2012-10-041-0/+17
| | | | Count returns 0 without querying if parent is not saved
* Merge pull request #7822 from lulalala/reset-counter-cache-for-has-many-throughRafael Mendonça França2012-10-021-0/+5
| | | | | | | Fix reset_counters crashing on has_many :through associations. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb
* ConnectionPool accepts spec key 'checkout_timeout'Jonathan Rochkind2012-09-241-0/+6
| | | | | | | Backport of #6441 cb6f83935 . Old 'wait_timeout' is still supported, but conflicts with mysql2 using that spec key for different thing. 'checkout_timeout' can now be used taking precedence for ConnectionPool over 'wait_timeout'.
* Merge pull request #3544 from amatsuda/_field_changedAaron Patterson2012-09-211-0/+4
| | | | | | | | Rename field_changed? to _field_changed? so that users can create a field named field Conflicts: activerecord/lib/active_record/core.rb activerecord/test/cases/dirty_test.rb
* Revert "backport fair connection pool 02b2335563 to 3-2-stable"Rafael Mendonça França2012-09-201-5/+0
| | | | | | | | | | | | | This reverts commit 0693e079708a52b777f2b7872b8e3d467b880a0d. Revert "Cache columns metadata to avoid extra while testing" This reverts commit a82f1e3f5d11c8dfba9f4c911745ec40a7965216. Reason: This is causing failures in the postgresql build. See http://travis-ci.org/#!/rails/rails/builds/2485584 Related with #7675
* backport fair connection pool 02b2335563 to 3-2-stableJonathan Rochkind2012-09-171-0/+5
|
* Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmtRafael Mendonça França2012-09-171-0/+6
| | | | Fix collection= on hm:t join models when unsaved
* Backport explain fixes.Rafael Mendonça França2012-09-161-0/+6
| | | | | | | | * Mark as SCHEMA some schema database queries. #7648 * Don't explain queries except normal CRUD sql. #7657 Closes #6458 Closes #7544
* fix markdown markup in AR/CHANGELOGFrancesco Rodríguez2012-09-131-1/+1
|
* Backport PostgreSQL auto-reconnect test coverageSteve Jorgensen2012-09-131-0/+5
| | | | | | | | | | | | | | | | 6d5f4de4c420ebb906109668f5702a537ac77692 Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests. 4b1bca04025a66c54e6e9d5eb6e4d4056bfa92f0 Stop being silly with formatting of method aliasing. c381d5cbf959208adeb38e7859ee815dfbd2cf54 Fix just-plain-wrongness of psql auto-reconnect test. 1e17a9d367c54c680368be72f44247ae28b98904 Fix only-once stub logic. f16c2043826ec1991cf94fe17cb671507b7a7f51 Changelog for PostgreSQL auto-reconnect test coverage backport.
* Backported #7572 to 3-2-stable. Use config['encoding'], because database ↵kennyj2012-09-121-0/+6
| | | | configuration use not charset but encoding.
* Merge pull request #7582 from tchandy/fix_type_cast_codeRafael Mendonça França2012-09-091-0/+4
|\ | | | | type_cast_code should always convert values to integer calling #to_i
| * ConnectionAdapters::Column.type_cast_code should always convert values to ↵Thiago Pradi2012-09-091-0/+4
| | | | | | | | integer calling #to_i