aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix for time type columns with invalid timeAdam Meehan2012-09-051-0/+12
| | | | | | 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.
* test cleanup, remove ruby_type because it's no longer neededYves Senn2012-09-031-1/+1
| | | | | All tests with a custom inheritance_column use the `Vegtable` model. The field ruby_type on the Company models is no longer needed
* 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.
* Move the serialized attribute tests to their own fileRafael Mendonça França2012-08-261-196/+0
|
* Move test to the correct fileRafael Mendonça França2012-08-261-0/+6
|
* Use instance_accessor: false instead of instance_writer.kennyj2012-08-211-0/+6
|
* Fix occasional microsecond conversion inaccuracyAri Pollak2012-08-151-0/+1
| | | | | | | | | ActiveRecord::ConnectionAdapters::Column#microseconds did an unnecessary conversion to from Rational to float when calculating the integer number of microseconds. Some terminating decimal numbers in base10 are repeating decimal numbers in base2 (the format of float), and occasionally this causes a rounding error. Patch & explanation originally from Logan Bowers.
* Remove ActiveRecord::Base.to_aJon Leighton2012-08-031-11/+3
| | | | | On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
* Revert "Removing composed_of from ActiveRecord."Rafael Mendonça França2012-07-271-0/+65
| | | | | | | | | | | This reverts commit 14fc8b34521f8354a17e50cd11fa3f809e423592. Reason: we need to discuss a better path from this removal. Conflicts: activerecord/lib/active_record/reflection.rb activerecord/test/cases/base_test.rb activerecord/test/models/developer.rb
* Deprecate ActiveRecord::Base.scoped.Jon Leighton2012-07-271-24/+24
| | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
* ActiveRecord::Base.all returns a Relation.Jon Leighton2012-07-271-25/+33
| | | | | | | | | | | Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway.
* Refactor ActiveRecord::Inheritance.base_class logicbeerlington2012-07-261-12/+0
| | | | | | | | | Moved logic from class_of_active_record_descendant(class) to the base_class method. This method was confusing because it required an argument, but that argument was 'self'. Moved base_class tests to inheritance_test.rb and added some test coverage for some untested cases.
* Deprecate update_column in favor of update_columns.Rafael Mendonça França2012-07-241-2/+2
| | | | Closes #1190
* AR::Integration must be included after AM::ConversionJohn Firebaugh2012-07-171-0/+6
| | | | | | | Integration's definition of #to_param must override Conversion's. Otherwise, there is a regression from 3.1 in the behavior of a non-persisted AR::Base instance which nevertheless has an id.
* Remove some aggregation tests related to composed_ofCarlos Antonio da Silva2012-06-281-20/+0
| | | | | | | | | | | Since composed_of was removed in 051747449e7afc817c599e4135bc629d4de064eb, these tests were working "by mistake", due to the matching "address" string in the error message, but with a different error message than the expected multiparameter assignment error. Since "address" is not an attribute from Customer anymore, the error was "undefined method klass for nil", where nil was supposed to be the column object.
* Move newly added multiparameter tests to base_test fileCarlos Antonio da Silva2012-06-281-0/+35
| | | | | All other multiparameter assignment tests are in the same file, so it makes sense to have all of them here.
* Setup each test with default ActiveRecord timezone settings to ensure each ↵Erich Menge2012-06-261-20/+8
| | | | | | test starts with a clean slate. Fixes #6867.
* Revert "Merge pull request #6344"Piotr Sarnacki2012-06-251-9/+3
| | | | | | | | | | | | | | This commit needs to be reverted because it introduces difficulties when using sqlite3 in development and other databases in production. This happens because when you create time column in sqlite3, it's dumped as datetime in schema.rb file. This reverts commit 57d534ee9e441d078fcc161c0c78ebaa5aacd736, reversing changes made to 20f049fb50daee0c5e5a69b55b529af5737e8e3f. Conflicts: activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
* Merge pull request #6743 from steveklabnik/remove_composed_ofRafael Mendonça França2012-06-181-44/+0
|\ | | | | | | Removing composed_of
| * Removing composed_of from ActiveRecord.Steve Klabnik2012-06-181-44/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature adds a lot of complication to ActiveRecord for dubious value. Let's talk about what it does currently: class Customer < ActiveRecord::Base composed_of :balance, :class_name => "Money", :mapping => %w(balance amount) end Instead, you can do something like this: def balance @balance ||= Money.new(value, currency) end def balance=(balance) self[:value] = balance.value self[:currency] = balance.currency @balance = balance end Since that's fairly easy code to write, and doesn't need anything extra from the framework, if you use composed_of today, you'll have to add accessors/mutators like that. Closes #1436 Closes #2084 Closes #3807
* | Add ensure Joke.reset_sequence_nameYasuo Honda2012-06-191-0/+2
|/ | | | | to avoid ORA-02289: sequence does not exist for `SELECT "BLACK_JOKES_SEQ".NEXTVAL FROM dual`
* Remove update_attribute.Steve Klabnik2012-06-141-1/+1
| | | | | | | | | | | Historically, update_attribute and update_attributes are similar, but with one big difference: update_attribute does not run validations. These two methods are really easy to confuse given their similar names. Therefore, update_attribute is being removed in favor of update_column. See the thread on rails-core here: https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-core/BWPUTK7WvYA
* Fix #5797. Error calling dup method on AR model with serialized fieldkennyj2012-05-301-0/+9
|
* Merge pull request #6376 from jgaskins/timestamp-microsecondsJeremy Kemper2012-05-181-1/+1
|\ | | | | Increase numeric-timestamp precision to nanoseconds
| * Increase `AR#cache_key` precision to nanosecondsJamie Gaskins2012-05-191-1/+1
| |
* | quarantine more deprecated stuffJon Leighton2012-05-181-18/+0
|/
* SQLite3 doesn't actually support the 'time' type.Erich Menge2012-05-151-3/+9
|
* Remove unnecessary assertions. We should only test the before_seq isn't same ↵kennyj2012-05-161-5/+1
| | | | to the after_seq when using sequencer.
* Duplicate column_defaults properly (closes #6115)Piotr Sarnacki2012-05-041-1/+7
|
* remove useless assertionsAaron Patterson2012-04-301-10/+3
|
* return value of block is returnedAaron Patterson2012-04-301-1/+9
|
* only yield to finder block if something is foundAaron Patterson2012-04-301-0/+10
|
* removed deprecation warningsAndrey Deryabin2012-04-281-1/+1
|
* find and replace deprecated keysJon Leighton2012-04-271-5/+5
|
* %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵Jon Leighton2012-04-271-22/+22
| | | | things
* fix tests for SQLite3AdapterAndrey Deryabin2012-04-271-1/+1
|
* remove calls to find(:first), find(:last) and find(:all)Jon Leighton2012-04-261-5/+5
|
* remove deprecate #calculate callsJon Leighton2012-04-261-10/+4
|
* remove tests for #with_scope (it's now deprecated)Jon Leighton2012-04-251-78/+0
|
* Extract deprecated codeJon Leighton2012-04-251-0/+5
|
* Fix wrong return value from reset_sequence_name method.kennyj2012-04-141-2/+6
|
* Add Relation#find_by and Relation#find_by!Jon Leighton2012-03-301-0/+14
|
* Add ActiveRecord::Base#slice to slice method callsGuillermo Iguaran2012-03-291-0/+12
|
* attributes are cached by string keys, so to_s to support symbols. fixes #5549Aaron Patterson2012-03-271-1/+15
|
* changed all.map to pluckSandeep2012-03-191-1/+1
|
* Merge pull request #5327 from kennyj/fix_explicitly_inheraitance_columnAaron Patterson2012-03-151-0/+10
|\ | | | | Don't reset inheritance_column when setting explicitly.
| * Don't reset inheritance_column when setting explicitly.kennyj2012-03-081-0/+10
| |
* | Remove IdentityMapCarlos Antonio da Silva2012-03-131-2/+2
|/
* Merge pull request #5268 from carlosantoniodasilva/ar-new-record-warningJon Leighton2012-03-041-0/+9
|\ | | | | Fix ActiveRecord warning in tests with Marshal
| * Initialize @stale_state to nil in associationCarlos Antonio da Silva2012-03-041-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This apparently fix the warning related to @new_record variable not being initialized in AR's test suit, when an association is built and the object is marshalled/loaded. See these tests in AR's base_test.rb: test_marshalling_with_associations test_marshalling_new_record_round_trip_with_associations Closes #3720.