aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Let Ruby deal with method visibility.Jon Leighton2011-09-131-3/+3
| | | | | | Check respond_to_without_attributes? in method_missing. If there is any method that responds (even private), let super handle it and raise NoMethodError if necessary.
* Always generate attribute methods on the base class.Jon Leighton2011-09-131-0/+16
| | | | | | | | | | | | | | This fixes a situation I encountered where a subclass would cache the name of a generated attribute method in @_defined_class_methods. Then, when the superclass has it's attribute methods undefined, the subclass would always have to dispatch through method_missing, because the presence of the attribute in @_defined_class_methods would mean that it is never generated again, even if undefine_attribute_methods is called on the subclass. There various other confusing edge cases like this. STI classes share columns, so let's just keep all the attribute method generation state isolated to the base class.
* Revert "Merge pull request #2543 from htanata/unused_require_in_ar_test"Santiago Pastorino2011-08-161-0/+1
| | | | | This reverts commit 87152f2604e73b218df90befda576f0acfed0bbf, reversing changes made to 0d3615f04c79f6e90d8ab33fdfc920b8faac9cb8.
* Remove unused require.Hendy Tanata2011-08-161-1/+0
|
* Resolve warnings by instantizing @attrubtes as nilBrian Cardarella2011-07-301-0/+1
|
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* Fix broken test. You know, the merge button will be the end of us...Jon Leighton2011-06-011-3/+3
|
* Adding commentArun Agrawal2011-06-011-0/+1
|
* AttributeMethodTest test fix #jrubyVishnu Atrai2011-06-011-1/+5
|
* Test AR::Base#inspect on an allocated object not yet initializedFranck Verrot2011-05-251-0/+8
|
* Undo performances regressions I introduced in ↵Jon Leighton2011-04-151-0/+11
| | | | bbe0a507f287c20ab4ae8a244fbfc810665deda5 and add test for an edge case. Add comments to explain the intent of the code.
* Remove unnecessary code from define_read_method and add assertion to make ↵Jon Leighton2011-04-151-0/+1
| | | | sure the underscored version is actually generated
* Remove `#among?` from Active SupportPrem Sichanugrist2011-04-131-1/+1
| | | | | | After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now. It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
* Change Object#either? to Object#among? -- thanks to @jamesarosen for the ↵David Heinemeier Hansson2011-04-121-1/+1
| | | | suggestion!
* Using Object#in? and Object#either? in various placesPrem Sichanugrist2011-04-111-1/+2
| | | | There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
* cleaning up typecast test a littleAaron Patterson2011-03-261-6/+8
|
* refactoring tz to a variable rather than repeating itAaron Patterson2011-03-261-2/+4
|
* adding a test for attributes after type cast. thanks nragaz. :heart:Aaron Patterson2011-03-261-0/+17
|
* fixing whitespace errors. :bomb:Aaron Patterson2011-03-251-2/+2
|
* Fix before_type_cast for timezone aware attributes by caching converted ↵Adam Meehan2011-03-231-15/+11
| | | | value on write. Also remove read method reload arg on timezone attributes.
* bugfix for serialized_attributes to be class specificRaimonds Simanovskis2011-02-091-0/+5
| | | | previously serialized_attributes were kept as class attribute of ActiveRecord::Base - if some attribute was defined as serialized in one subclass then it was serialized in all other subclasses as well (if it had the same name)
* do not to_s where you are testing that a string value is stored for the ↵Akira Matsuda2011-02-071-1/+1
| | | | | | before_type_cast Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* avoid nil.dupAkira Matsuda2011-02-071-0/+8
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fix for test_read_attributes_before_type_cast_on_datetime - Oracle adapter ↵Raimonds Simanovskis2011-02-021-2/+2
| | | | also returns Time value
* Make before_type_cast available for datetime fieldsAkira Matsuda2011-02-011-16/+15
| | | | | | [#3973 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Add test for e0e3adfJeremy Kemper2011-01-071-0/+6
|
* Allow primary_key to be an attribute when the model is a new recordSantiago Pastorino2010-12-281-1/+1
|
* fixing space errorsAaron Patterson2010-12-021-3/+1
|
* Work around a strange piece of Syck behaviour where it checks ↵Michael Koziarski2010-12-021-0/+11
| | | | | | Model#respond_to? before initializing the object. Things like YAML.load(YAML.dump(@post)) won't work without this.
* removing many unused variablesAaron Patterson2010-11-161-1/+1
|
* mysql tests are mostly passingAaron Patterson2010-10-261-3/+3
|
* Fewer object allocationsJeremy Kemper2010-09-091-3/+3
|
* Cache unserialized attributesJeremy Kemper2010-09-091-9/+12
|
* Do not use time zone in test_read_attributes_before_type_cast_on_datetime ↵Raimonds Simanovskis2010-08-221-3/+3
| | | | | | for Oracle database As currently string_to_time method is not doing time zone conversion to database time zone
* Both tests are using the same model, move the model to another file and add ↵Santiago Pastorino2010-08-141-1/+2
| | | | the missing require
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-4/+4
| | | | 's/[ \t]*$//' -i {} \;)
* ignore this test for mysql2Brian Lopez2010-08-091-13/+15
|
* Making Active Record base_test.rb thinner by moving testsNeeraj Singh2010-08-031-2/+276
| | | | | | | | | | | | to relevant files. Number of assertions before refactoring: 2391 tests, 7579 assertions, 0 failures, 0 errors Number of assertions after refactoring: 2391 tests, 7579 assertions, 0 failures, 0 errors Signed-off-by: José Valim <jose.valim@gmail.com>
* Use better assertion methods for testingNeeraj Singh2010-05-191-1/+1
| | | | | | [#4645 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* 1=2 is invalid expression in Oracle SELECTRaimonds Simanovskis2009-08-061-2/+12
|
* Extract generic attribute method generation to AMoJoshua Peek2009-08-041-47/+0
|
* Modified ActiveRecord::AttributeMethods to allow classes to specify ↵Paul Gillard2009-08-041-15/+79
| | | | | | attribute method prefixes and/or suffixes. Previously only suffixes were allowed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Undefine id and let it automatically be generatedJoshua Peek2009-07-301-4/+0
|
* Restore DangerousAttributeErrorJoshua Peek2009-07-301-0/+14
|
* Generate methods for all suffixesJoshua Peek2009-07-301-14/+0
|
* Make it so AR attributes which conflict with object-private methods (e.g. ↵Sam Goldstein2009-07-091-0/+16
| | | | | | | | | system) don't 'randomly' cause NoMethodErrors Previously if you called this attribute before others, you'd get exceptions. But if it was the second-or-subsequent attribute you retrieved you'd get the correct behaviour. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2808 state:committed]
* Ruby 1.9 compat: rename deprecated assert_raises to assert_raise.Jeremy Kemper2009-03-081-1/+1
| | | | [#1617 state:resolved]
* Support true/false in query_attribute for calculated columnsMax Lapshin2009-02-061-0/+12
| | | | | Signed-off-by: Tarmo Tänav <tarmo@itech.ee> Signed-off-by: Michael Koziarski <michael@koziarski.com>
* "raise NoMethodError" raises NoMethodError. Raise it with NoMethodError.new ↵Mike Gunderloy2008-10-251-4/+7
| | | | | | instead. Signed-off-by: Pratik Naik <pratiknaik@gmail.com>