aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | Use nil? instead of blank? to check dynamic finder resultNikita Afanasenko2012-11-134-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-136-1/+31
|/ / / / / | | | | | | | | | | | | | | | with optimistic locking enabled. Fixes #5332.
* / / / / Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only ↵kennyj2012-11-143-6/+22
|/ / / / | | | | | | | | | | | | database.yml but also DATABASE_URL.
* | | | Fix warning with assigned but not used variableCarlos Antonio da Silva2012-11-131-3/+3
| | | |
* | | | Update mocha version to 0.13.0 and change requiresCarlos Antonio da Silva2012-11-131-1/+1
| | | |
* | | | 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-123-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-093-0/+24
| | | | | | | | | | | | 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-083-3/+28
|\ \ \ | | | | | | | | | | | | | | | | 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-083-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/batches.rb
| * | | Fix test_find_in_batches_should_use_any_column_as_primary_keySantiago Pastorino2012-11-081-11/+8
| | | |
| * | | start could be a stringSantiago Pastorino2012-11-082-1/+16
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Related to 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 and eb876c4d07130f15be2cac7be968cc393f959c62 Conflicts: activerecord/lib/active_record/relation/batches.rb activerecord/test/cases/batches_test.rb
* | | Use a more descriptive test nameRafael Mendonça França2012-11-081-1/+1
| | |
* | | 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-073-3/+41
|/ / | | | | | | 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-012-1/+11
| | | | | | | | Also related to #8087. Thanks @al2o3cr.
* | Fix issue with collection associations and first(n)/last(n)Carlos Antonio da Silva2012-11-013-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | relaxes assertionXavier Noria2012-10-311-1/+1
| | | | | | | | | | | | | | | | | | This method returns the status of the operation, but as we generally do in the code base it does not commit to any particular exact value. Hence, we do not have to check for a singleton, because if the implementation changes and returns some other true value the test should pass.
* | Fix ActiveRecord#update_column return valuesaksmlz2012-10-312-1/+7
| |
* | Add CHANGELOG entry to #8032 fixRafael Mendonça França2012-10-291-0/+5
| | | | | | | | | | | | e6b41845efe2252fe7de6882e355c31f93c65cc3 fixes that issue too. [ci skip]
* | 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-293-6/+22
| | | | | | | | | | | | | | | | 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-294-37/+57
|\ \ | | | | | | | | | fixed support for DATABASE_URL for rake db tasks
| * | fixed support for DATABASE_URL for rake db tasksGrace Liu2012-10-294-37/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-292-1/+9
| | | | | | | | | | | | 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-293-1/+17
| | | | | | | | | | | | | | | | 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-292-3/+2
| | | | | | | | Also remove the feature detecting for Ruby 1.9
* | Fix the skip code.Rafael Mendonça França2012-10-281-4/+4
| | | | | | | | Checking for the constant doesn't work
* | Merge pull request #7593 from veader/patch-1Rafael Mendonça França2012-10-283-0/+14
| | | | | | | | | | | | | | 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-222-2/+18
| |
* | 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-173-0/+21
| | | | | | | | | | | | | | 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-152-1/+4
| | | | | | | | Fixes #7955
* | 7914 Using a better way to get the defaults from db.Arturo Pie2012-10-141-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: * According to postgreSQL documentation: (http://www.postgresql.org/docs/8.2/static/catalog-pg-attrdef.html) we should not be using 'adsrc' field because this field is unaware of outside changes that could affect the way that default values are represented. Thus, I changed the queries to use "pg_get_expr(adbin, adrelid)" instead of the historical "adsrc" field. * Remove parsing of character type default values for 8.1 formatting since Rails doesn't support postgreSQL 8.1 anymore. * Remove misleading comment unrelated to code.
* | #7914 get default value when type uses schema nameArturo Pie2012-10-144-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-123-1/+15
| | | | | | | | | | | | | | | | | | | | 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.
* | Eager autoload Preloader classesJohn Firebaugh2012-10-101-10/+14
| | | | | | | | | | | | Without eager autoloading, these would be autoloaded only when #preloader_for is called, which is too late in threaded applications.
* | Eager autoload ActiveRecord association helpersMichael Fairley2012-10-101-5/+7
| |
* | Merge pull request #7850 from ↵Rafael Mendonça França2012-10-063-5/+14
| | | | | | | | | | | | | | | | | | 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-045-0/+37
| | | | | | | | Count returns 0 without querying if parent is not saved
* | RefactorSantiago Pastorino2012-10-031-5/+3
| | | | | | | | | | Conflicts: activerecord/lib/active_record/counter_cache.rb
* | Merge pull request #7822 from lulalala/reset-counter-cache-for-has-many-throughRafael Mendonça França2012-10-025-4/+29
| | | | | | | | | | | | | | Fix reset_counters crashing on has_many :through associations. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb
* | backport 68677ffb8298105eb9d3efa26d928dd88cc5e006Evan Petrie2012-09-284-6/+13
| |
* | ConnectionPool accepts spec key 'checkout_timeout'Jonathan Rochkind2012-09-244-5/+39
| | | | | | | | | | | | | | 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'.