aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
Commit message (Collapse)AuthorAgeFilesLines
* Speed up attribute invocation by checking if both name and calls are compilable.José Valim2011-11-142-2/+2
|
* Revert "Raise error on unknown primary key."Jon Leighton2011-10-053-11/+4
| | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
* Raise error on unknown primary key.Jon Leighton2011-10-053-4/+11
| | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307.
* Don't require a DB connection when setting primary key.Jon Leighton2011-09-261-1/+0
| | | | Closes #2807.
* Raise error when using write_attribute with a non-existent attribute.Jon Leighton2011-09-131-3/+7
| | | | | | | | | Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing.
* Add deprecation for doing `attribute_method_suffix ''`Jon Leighton2011-09-131-2/+0
|
* Alias id= if necessary, rather than relying on method_missingJon Leighton2011-09-131-0/+4
|
* Revert "to_key on a destroyed model should return nil". Closes #2440Santiago Pastorino2011-08-051-3/+2
| | | | This reverts commit c5448721b5054b8a467958d60427fdee15eac604.
* to_key on a destroyed model should return nilSantiago Pastorino2011-07-091-1/+1
|
* only calculate method name onceAaron Patterson2011-06-301-2/+3
|
* Remove trailing white-spacesGuillermo Iguaran2011-06-051-1/+1
|
* Remove extra white spaces on ActiveRecord docs.Sebastian Martinez2011-05-231-1/+1
|
* Avoid define_method if possible.José Valim2011-04-192-2/+2
|
* Return nil from read_attribute(:foo) if 'foo' is not present in the ↵Jon Leighton2011-04-151-1/+1
| | | | @attributes hash, but the _foo method has been defined. This brings the behaviour into line with the 3-0-stable branch and the master branch before 93641ed6c8c684f6b4db02b6c8a22fa9bc7f0eaf (there were previously no assertions about this which is why the change slipped through). Note that actually calling the 'foo' method will still raise an error if the attribute is not present.
* Undo performances regressions I introduced in ↵Jon Leighton2011-04-151-5/+23
| | | | 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-7/+4
| | | | sure the underscored version is actually generated
* Fixes performance issue introduced in 3.0.6 (issue #6695)Stian Grytøyr2011-04-141-3/+5
|
* 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?.
* Quote find_in_batches ORDER BY clause [#6620 state:resolved]Andrew White2011-03-291-1/+12
|
* Added new #update_column method.Sebastian Martinez2011-03-271-0/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Fix before_type_cast for timezone aware attributes by caching converted ↵Adam Meehan2011-03-231-4/+5
| | | | value on write. Also remove read method reload arg on timezone attributes.
* use class_eval with a string when it's possibleSantiago Pastorino2011-03-222-5/+13
|
* Allow to read and write AR attributes with non valid identifiersSantiago Pastorino2011-03-222-2/+7
|
* Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-153-26/+37
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/examples/performance.rb activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/nested_attributes.rb activerecord/test/cases/relations_test.rb
| * primary keys should not be cleared on cache clear, fixing oracle testsAaron Patterson2011-02-081-0/+1
| |
| * avoid nil.dupAkira Matsuda2011-02-071-1/+1
| | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
| * make sure de-serialization happens on object instantiationAaron Patterson2011-02-012-3/+2
| |
| * store the serialized column values in the @attributes hashAaron Patterson2011-02-011-1/+2
| |
| * move the coders to the serialized_attributes hashAaron Patterson2011-02-011-7/+3
| |
| * Make before_type_cast available for datetime fieldsAkira Matsuda2011-02-011-2/+3
| | | | | | | | | | | | [#3973 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
| * use an identity conversion to avoid conditional codesAaron Patterson2011-01-281-2/+2
| |
| * join the cult of cargo. reduce the number of NoMethodErrors in the systemAaron Patterson2011-01-071-1/+1
| |
| * no need for to_symAaron Patterson2011-01-071-1/+1
| |
| * String#insert() mutates the string, so no need for lasgnAaron Patterson2011-01-071-1/+1
| |
| * fewer funcalls to the cached attributes variableAaron Patterson2011-01-071-1/+1
| |
| * stop redifining methods on every call to set_primary_keyAaron Patterson2010-12-241-4/+11
| |
| * returning id (for some yet to be discovered reason)Aaron Patterson2010-12-201-1/+1
| |
| * define_attr_method must serialize nil correctlyAaron Patterson2010-12-201-2/+6
| |
| * if there is no base name, we cannot determine a primary keyAaron Patterson2010-12-201-2/+4
| |
| * remove some lasignsAaron Patterson2010-12-201-6/+6
| |
* | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2010-12-204-12/+17
|\| | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb
| * Ensure that boolean false is properly serialized [#6079 state:resolved]Aditya Sanghi2010-12-081-1/+2
| |
| * Fix indentation hereSantiago Pastorino2010-12-041-7/+8
| |
| * attributes_before_type_cast are just the value of @attributesSantiago Pastorino2010-12-041-1/+1
| |
| * class inheritable attributes is used no more! all internal use of class ↵Josh Kalderimis2010-11-202-3/+6
| | | | | | | | | | | | inheritable has been changed to class_attribute. class inheritable attributes has been deprecated. Signed-off-by: José Valim <jose.valim@gmail.com>
* | Remove objects from identity map if save! failed, otherwise finding again ↵Emilio Tagua2010-11-191-0/+3
| | | | | | | | the same record will have invalid attributes.
* | Remove objects from identity map if save failed, otherwise finding again the ↵Emilio Tagua2010-11-191-0/+2
|/ | | | same record will have invalid attributes.
* use persisted? instead of new_record? wherever possibleDavid Chelimsky2010-11-091-3/+4
| | | | | | | | | | | - persisted? is the API defined in ActiveModel - makes it easier for extension libraries to conform to ActiveModel APIs without concern for whether the extended object is specifically ActiveRecord [#5927 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>