aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #7536 from pivotal/fix_pluck_with_reserved_wordsRafael Mendonça França2012-09-055-3/+21
|\ \ \ \ \ | | | | | | | | | | | | Fix pluck when columns/tables are reserved words.
| * | | | | Fix pluck when columns/tables are reserved words.Ian Lesperance2012-09-055-3/+21
| | | | | |
* | | | | | Merge pull request #7525 from ↵Rafael Mendonça França2012-09-052-9/+10
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | seamusabshere/use-mysql-binary-for-rake-db-structure-load Use the 'mysql' binary for 'rake db:structure:load'
| * | | | | Use the 'mysql' binary for 'rake db:structure:load'.Seamus Abshere2012-09-052-9/+10
| |/ / / / | | | | | | | | | | | | | | | The previous implementation had the strange requirement that db/structure.sql contain only CREATE TABLE sql statements, one per table, separated by double newlines. SQLite3 and PostgreSQL database tasks, on the other hand, simply spawn 'sqlite3' and 'psql' binaries to load the file directly. The new implementation follows this and attempts to respect all current MySQL configuration settings.
* | | | | Merge pull request #7337 from adzap/string_to_dummy_timeRafael Mendonça França2012-09-053-1/+23
|\ \ \ \ \ | | | | | | | | | | | | Fix for time type columns with invalid time value
| * | | | | Update changelog with time column type casting fixAdam Meehan2012-09-051-0/+4
| | | | | |
| * | | | | Fix for time type columns with invalid timeAdam Meehan2012-09-052-1/+19
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | The string_to_dummy_time method was blindly parsing the dummy time string with Date._parse which returns a hash for the date part regardless of whether the time part is an invalid time string.
* | | | | Merge pull request #7447 from etehtsea/postgresql-adapterRafael Mendonça França2012-09-057-988/+1038
|\ \ \ \ \ | |/ / / / |/| | | | Modularize postgresql adapter
| * | | | Modularize postgresql adapterKonstantin Shabanov2012-09-057-988/+1038
| | |/ / | |/| |
* | | | test cleanup, remove ruby_type because it's no longer neededYves Senn2012-09-037-16/+5
| | | | | | | | | | | | | | | | | | | | All tests with a custom inheritance_column use the `Vegtable` model. The field ruby_type on the Company models is no longer needed
* | | | rewrite inheritance tests with a custom inheritance_columnYves Senn2012-09-034-49/+61
| | | | | | | | | | | | | | | | | | | | | | | | previously the tests with and without a custom `inheritance_column` used the same models. Since the model then has both fields this can lead to false positives.
* | | | set the configured #inheritance_column on #become (#7503)Yves Senn2012-09-035-2/+38
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had to create a new table because I needed an STI table, which does not have both a "type" and a "custom_type" the test fails with: 1) Error: test_alt_becomes_works_with_sti(InheritanceTest): NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber"> /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes' test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti' test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'
* | | Avoid #fetch for non-nil values.Jon Leighton2012-08-311-1/+2
| | | | | | | | | | | | | | | | | | This is purely a performance optimisation. See https://gist.github.com/3552829
* | | Key the attributes hash with symbolsJon Leighton2012-08-314-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | This is a performance/GC optimisation. In theory, this could be optimised by the implementation (last time I checked, this would have no effect on JRuby). But in practise, this make attribute access faster.
* | | Cache the connection pool for a given classJon Leighton2012-08-312-20/+37
| | |
* | | One hash is enoughJon Leighton2012-08-312-18/+14
| | | | | | | | | | | | We don't need separate @class_to_pool and @connection_pool hashes.
* | | Refactor connection handlerJon Leighton2012-08-311-22/+14
| | |
* | | Make connection pool retrieval fasterJon Leighton2012-08-313-20/+18
| | | | | | | | | | | | | | | | | | * Loop rather than recurse in retrieve_connection_pool * Key the hash by class rather than class name. This avoids creating unnecessary strings.
* | | Merge pull request #7481 from joliss/typoVijay Dev2012-08-301-3/+3
|\ \ \ | | | | | | | | Fix grammar
| * | | Fix grammarJo Liss2012-08-301-3/+3
| | | |
* | | | documents after_(commit|rollback)Xavier Noria2012-08-301-0/+18
|/ / /
* | | Add a test to make sure preloading properly merges association and default ↵Pratik Naik2012-08-283-0/+23
| | | | | | | | | | | | scope conditions
* | | CHANGELOGs are now per branchXavier Noria2012-08-281-6836/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes in old branches needed to be manually synched in CHANGELOGs of newer ones. This has proven to be brittle, sometimes one just forgets this manual step. With this commit we switch to CHANGELOGs per branch. When a new major version is cut from master, the CHANGELOGs in master start being blank. A link to the CHANGELOG of the previous branch allows anyone interested to follow the history.
* | | Merge pull request #7458 from frodsan/fix_orddep_basicsRafael Mendonça França2012-08-281-5/+5
|\ \ \ | | | | | | | | fix order dependent test in AR::BasicsTest
| * | | fix order dependent test in AR::BasicsTestFrancesco Rodriguez2012-08-271-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test https://github.com/rails/rails/blob/master/activerecord/test/cases/base_test.rb#L381 is failing because is not setting `CreditCard.pluralize_table_name` to `false`. In this case, i prefer to change to another model that is not in the `GUESSED_CLASSES` array.
* | | | ensures that the test repairs the validation setupFrancesco Rodriguez2012-08-271-7/+9
|/ / /
* | | fix order dependent test in AggregationsTestFrancesco Rodriguez2012-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure class variable is set to nil. It prevents the following test to fail: def test_do_not_run_the_converter_when_nil_was_set customers(:david).non_blank_gps_location = nil assert_nil Customer.gps_conversion_was_run end Check https://github.com/rails/rails/blob/master/activerecord/test/models/customer.rb#L7 for more information.
* | | Add test to ensure that save will raise SerializationTypeMismatch if theRafael Mendonça França2012-08-261-0/+6
| | | | | | | | | | | | serialized attribute value is not from the same class
* | | We don't need this reloadRafael Mendonça França2012-08-261-1/+1
| | |
* | | Use the Topic class in the attribute serialized testsRafael Mendonça França2012-08-261-8/+4
| | |
* | | Use teardown hook to return the initial state of the objectRafael Mendonça França2012-08-261-16/+5
| | |
* | | Move the serialized attribute tests to their own fileRafael Mendonça França2012-08-263-207/+214
| | |
* | | Move test to the correct fileRafael Mendonça França2012-08-263-12/+12
| | |
* | | Remove CHANGELOG entry for the update_attribute removal.Rafael Mendonça França2012-08-261-6/+0
| | | | | | | | | | | | We reverted the removal because the new deprecation policy
* | | Use verify_readonly_attribute in the update_columns methodRafael Mendonça França2012-08-251-1/+1
| | |
* | | Revert "Remove private verify readonly attr method"Rafael Mendonça França2012-08-251-1/+5
| | | | | | | | | | | | This reverts commit 7a8aee08b610f6edbfe5be076dc14e5cdcf1355e.
* | | Revert "Remove update_attribute."Rafael Mendonça França2012-08-254-7/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a7f4b0a1231bf3c65db2ad4066da78c3da5ffb01. Conflicts: activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/persistence.rb activerecord/test/cases/base_test.rb activerecord/test/cases/dirty_test.rb activerecord/test/cases/timestamp_test.rb
* | | changelog #7449Mikhail Dieterle2012-08-261-0/+4
| | |
* | | allow to pass Symbol or Proc into :limit option of ↵Mikhail Dieterle2012-08-263-11/+45
| | | | | | | | | | | | #accepts_nested_attributes_for
* | | use Hash#fetch to eliminate conditionalAaron Patterson2012-08-241-8/+3
| | |
* | | call methods on AR::Model after ClassMethods module is definedAaron Patterson2012-08-241-1/+2
| | |
* | | Extract ActiveRecord::SessionStore from RailsPrem Sichanugrist2012-08-248-583/+3
| | | | | | | | | | | | | | | This functionality will be available from gem `active_record-session_store` instead.
* | | ivar will always be defined, so stop checkingAaron Patterson2012-08-231-3/+1
| | |
* | | Model.select takes a variable list of arguments.Isaac Sanders2012-08-232-11/+20
| | | | | | | | | | | | | | | | | | This is a cleaner version of #6916. Closes #3165.
* | | Update the documentation for the :autosave optionDavid Celis2012-08-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've noticed a caveat with the :autosave option biting people before. Questions arise about why they must explicitly save an associated object in their own before_save callbacks. I've updated the documentation as such to note to users that the :autosave callback occurs before any user defined callbacks. They must save the associated record themselves if altering it in their own callbacks. Signed-off-by: David Celis <david@davidcelis.com>
* | | Merge pull request #6606 from amatsuda/ar_relation_model_methodRafael Mendonça França2012-08-212-0/+6
|\ \ \ | | | | | | | | AR::Relation#model would be a better API than AR::Relation#klass
| * | | AR::Relation#model would be a better API than AR::Relation#klassAkira Matsuda2012-06-032-0/+6
| | | |
* | | | Merge pull request #7225 from rails/eager_loadJosé Valim2012-08-212-0/+12
|\ \ \ \ | | | | | | | | | | Improve eager load on Rails
| * | | | Get rid of config.preload_frameworks in favor of config.eager_load_namespacesJosé Valim2012-08-212-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly.
* | | | | Use a model without counter cache to test read-only attributesRafael Mendonça França2012-08-211-9/+10
|/ / / /