Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | Rename attribute related instance variables to better express intent | Sean Griffin | 2014-05-30 | 1 | -5/+5 | |
| | | | | | | | | | `@attributes` was actually used for `_before_type_cast` and friends, while `@attributes_cache` is the type cast version (and caching is the wrong word there, but I'm working on removing the conditionals around that). I opted for `@raw_attributes`, because `_before_type_cast` is also semantically misleading. The values in said hash are in the state given by the form builder or database, so raw seemed to be a good word. | |||||
* | docs, `instantiate` expects `String` keys. [Rafal Piekarski & Yves Senn] | Yves Senn | 2014-05-20 | 1 | -4/+4 | |
| | | | | | Closes #15122 Closes #15107 | |||||
* | Merge pull request #11650 from prathamesh-sonpatki/rename | Rafael Mendonça França | 2014-04-04 | 1 | -4/+4 | |
|\ | | | | | | | Renamed private methods _create_record and _update_record | |||||
| * | [Active Record] Renamed private methods create_record and update_record | Prathamesh Sonpatki | 2014-02-20 | 1 | -4/+4 | |
| | | | | | | | | | | | | This is to ensure that they are not accidentally called by the app code. They are renamed to _create_record and _update_record respectively. Closes #11645 | |||||
* | | Merge pull request #14390 from huoxito/true-touch | Rafael Mendonça França | 2014-03-25 | 1 | -0/+2 | |
|\ \ | | | | | | | | | | Still touch associations when theres no timestamp | |||||
| * | | Still touch associations when theres no timestamp | Washington Luiz | 2014-03-14 | 1 | -0/+2 | |
| | | | | | | | | | | | | | | | | | | | | | | | | Prior to Rails 4.0.4 when touching a object which doesn't have timestamp attributes (updated_at / updated_on) rails would still touch all associations. After 73ba2c14cd7d7dfb2d132b18c47ade995401736f it updates associations but rollsback because `touch` would return nil since there's no timestamp attribute | |||||
* | | | Improve touch docs with extra attributes passed in [ci skip] | Carlos Antonio da Silva | 2014-03-20 | 1 | -5/+7 | |
| | | | ||||||
* | | | ActiveRecord#touch should accept multiple attributes #14423 | Thiago Pinto | 2014-03-19 | 1 | -2/+3 | |
| | | | ||||||
* | | | Update callbacks executed on AR::Base#touch [skip ci] | Washington Luiz | 2014-03-14 | 1 | -2/+2 | |
|/ / | | | | | | | | | As of https://github.com/rails/rails/pull/12031 after_commit and after_rollback are also executed | |||||
* | | Enhance docs for update_attribute [ci-skip] | Mohamed Wael Khobalatte | 2014-03-12 | 1 | -0/+2 | |
| | | ||||||
* | | Replace "data store" with database [ci skip] | Robin Dupret | 2014-02-27 | 1 | -1/+1 | |
|/ | | | | Active Record is specifically for databases. Refs #12101. | |||||
* | Correctly send the string given to lock! and reload(:lock) to the lock scope ↵ | Mauricio Linhares | 2014-01-29 | 1 | -1/+1 | |
| | | | | | | - fixes #13788 As per the documentation at lock!, if the :lock option is a string it should use the given SQL to generate the lock statement. | |||||
* | fix bug in becomes! when changing from base to subclass. Closes #13272. | Yves Senn | 2014-01-13 | 1 | -1/+5 | |
| | ||||||
* | Change all "can not"s to the correct "cannot". | T.J. Schuck | 2014-01-03 | 1 | -2/+2 | |
| | ||||||
* | setting `changed_attributes` instance variable if it is already initialized. | Kuldeep Aggarwal | 2013-12-28 | 1 | -1/+1 | |
| | ||||||
* | Merge pull request #13474 from jdelStrother/becomes | Yves Senn | 2013-12-27 | 1 | -0/+1 | |
|\ | | | | | Copy changed_attributes across to newly become'd records | |||||
| * | Copy changed_attributes across to newly become'd records | Jonathan del Strother | 2013-12-27 | 1 | -0/+1 | |
| | | | | | | Without this, the original record's values won't get saved, since the partial insertions support (https://github.com/rails/rails/commit/144e8691cbfb8bba77f18cfe68d5e7fd48887f5e) checks for changed values and thinks there are none. | |||||
* | | Typo rectified commom => common[ci skip] | Aayush khandelwal | 2013-12-25 | 1 | -1/+1 | |
|/ | ||||||
* | [ci skip]removed obsolete information about `options` parameter in create method | Kuldeep Aggarwal | 2013-11-27 | 1 | -3/+0 | |
| | ||||||
* | Add documentation for after_touch [ci skip] | claudiob | 2013-10-08 | 1 | -1/+2 | |
| | ||||||
* | improving `reload` doc wording. #12418 [ci skip] | Yves Senn | 2013-10-02 | 1 | -1/+2 | |
| | ||||||
* | Update AR reload doc for the case of manually set primary key attribute [ci ↵ | Anatoli Makarevich | 2013-10-02 | 1 | -2/+11 | |
| | | | | skip] | |||||
* | Merge pull request #10816 from bogdan/less-dirty-dirty | Rafael Mendonça França | 2013-09-23 | 1 | -1/+1 | |
| | | | | Make AM::Dirty less dirty to plugin into AR or other library | |||||
* | Fix typo on instance variable get call | Carlos Antonio da Silva | 2013-09-12 | 1 | -1/+1 | |
| | ||||||
* | Perf: avoid dupes add fallback logic for coders | Sam | 2013-09-11 | 1 | -2/+3 | |
| | ||||||
* | rewrites AR's reload documentation | Xavier Noria | 2013-05-31 | 1 | -4/+38 | |
| | | | | | | | | | | | | | | * It is no longer true that options are passed to find. * Documents that ActiveRecord::RecordNotFound may be raised. * Documents that the reload happens in-place. * Documents that caches are wiped. * Documents that the method returns self. * Documents a couple of use cases. | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2013-05-01 | 1 | -0/+8 | |
|\ | ||||||
| * | readonly info for save and save! | Neeraj Singh | 2013-04-17 | 1 | -0/+6 | |
| | | ||||||
| * | updated rdoc to reflect info about readonly attribute | Neeraj Singh | 2013-04-17 | 1 | -0/+2 | |
| | | ||||||
* | | Moved update_record logic to relation.rb | Noemj | 2013-04-30 | 1 | -15/+3 | |
| | | ||||||
* | | Fix a SystemStackError that occurs when using time zone aware attributes. | Dan Erikson | 2013-04-25 | 1 | -1/+1 | |
|/ | | | | This fixes issue #10066 | |||||
* | Fix updates not working within after_create hooks | Aaron Pfeifer | 2013-03-27 | 1 | -1/+1 | |
| | ||||||
* | When we pass id to update_attributes it will try to set new id for that record | Dmitry Vorotilin | 2013-03-22 | 1 | -1/+1 | |
| | ||||||
* | Deprecate #connection in favour of accessing it via the class | Ben Moss | 2013-03-09 | 1 | -1/+1 | |
| | | | | | This allows end-users to have a `connection` method on their models without clashing with ActiveRecord internals. | |||||
* | Merge pull request #9409 from wangjohn/adding_documentation_to_touch | Carlos Antonio da Silva | 2013-02-25 | 1 | -0/+7 | |
|\ | | | | | Added documentation to touch throwing an error | |||||
| * | Added documentation about how touch now throws an error when one tries | wangjohn | 2013-02-25 | 1 | -0/+7 | |
| | | | | | | | | to use it on an unpersisted object. | |||||
* | | Merge pull request #9246 from Noemj/update_prepared_statements | Aaron Patterson | 2013-02-24 | 1 | -3/+12 | |
|\ \ | |/ |/| | Changed update to use prepared statements | |||||
| * | Changed update_record to use prepared statements. | Noemj | 2013-02-11 | 1 | -3/+12 | |
| | | ||||||
* | | Raising an ActiveRecordError when one tries to use .touch(name) on a new | wangjohn | 2013-02-25 | 1 | -0/+2 | |
| | | | | | | | | | | object that has not yet been persisted. This behavior follows the precedent set by update_columns. | |||||
* | | Reduced memory leak problem in transactions by lazily updating AR objects ↵ | wangjohn | 2013-02-20 | 1 | -0/+2 | |
| | | | | | | | | with new transaction state. If AR object has a callback, the callback will be performed immediately (non-lazily) so the transaction still has to keep records with callbacks. | |||||
* | | Refactor to use each_key, remove extra spaces | Carlos Antonio da Silva | 2013-01-28 | 1 | -2/+2 | |
|/ | ||||||
* | iterates the RDoc of update_column(s) | Xavier Noria | 2013-01-18 | 1 | -13/+13 | |
| | | | | | | | | This revision makes crystal clear that the methods go straight to the database and update the receiver. It also adds and example, and removes the duplication in the singular and plural forms by referring one to the other. | |||||
* | Change docs to use update instead of update_attributes | Amparo Luna + Guillermo Iguaran | 2013-01-03 | 1 | -1/+1 | |
| | ||||||
* | Rename update_attributes method to update, keep update_attributes as an alias | Amparo Luna + Guillermo Iguaran | 2013-01-03 | 1 | -5/+9 | |
| | ||||||
* | Unscope update_column(s) query to ignore default scope | Carlos Antonio da Silva | 2012-12-06 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | | | | | | | When applying default_scope to a class with a where clause, using update_column(s) could generate a query that would not properly update the record due to the where clause from the default_scope being applied to the update query. class User < ActiveRecord::Base default_scope where(active: true) end user = User.first user.active = false user.save! user.update_column(:active, true) # => false In this situation we want to skip the default_scope clause and just update the record based on the primary key. With this change: user.update_column(:active, true) # => true Fixes #8436. | |||||
* | Move instantiation responsibilities from Inheritance to Persistence. Have ↵ | Jeremy Kemper | 2012-11-29 | 1 | -0/+26 | |
| | | | | Inheritance#discriminate_class_for_record handle STI lookup duties. | |||||
* | Remove observers and sweepers | Rafael Mendonça França | 2012-11-28 | 1 | -1/+1 | |
| | | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik] | |||||
* | Remove return guard and use code convetions | Rafael Mendonça França | 2012-11-20 | 1 | -7/+11 | |
| | ||||||
* | Remove not needed begin..end from AR#save | Carlos Antonio da Silva | 2012-11-19 | 1 | -5/+3 | |
| | ||||||
* | AR::Base.becomes should not change the STI type | Thomas Hollstegge | 2012-11-17 | 1 | -1/+12 | |
| | | | | If you want to change the STI type too, use AR::Base.becomes! instead |