Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | remove private attribute reader | Aaron Patterson | 2013-07-02 | 1 | -6/+2 | |
| | ||||||
* | define attribute methods in a thread safe manner | Aaron Patterson | 2013-07-02 | 1 | -5/+4 | |
| | ||||||
* | we don't need to use active support *everwhere* common. | Aaron Patterson | 2013-07-02 | 1 | -1/+1 | |
| | ||||||
* | initialize ivars so we don't have to constantly check them | Aaron Patterson | 2013-07-02 | 1 | -1/+3 | |
| | ||||||
* | eagerly initialize the attributes module to avoid check-then-set race conditions | Aaron Patterson | 2013-07-02 | 1 | -1/+12 | |
| | ||||||
* | fixes a test, and explains why AR::AttributeMethods checks ↵ | Xavier Noria | 2013-04-28 | 1 | -0/+3 | |
| | | | | defined?(@attributes) in some places | |||||
* | ActiveRecord -> Active Record | Xavier Noria | 2013-04-25 | 1 | -1/+1 | |
| | ||||||
* | fixes warning in the AR test suite | Xavier Noria | 2013-04-25 | 1 | -1/+1 | |
| | ||||||
* | if singletons belong to the contract, test them | Xavier Noria | 2013-04-20 | 1 | -1/+1 | |
| | | | | | | Object#respond_to? returns singletons and thus we inherit that contract. The implementation of the predicate is good, but the test is only checking boolean semantics, which in this case is not enough. | |||||
* | fix respond_to? for non selected column | Neeraj Singh | 2013-04-19 | 1 | -1/+13 | |
| | | | | | | | | | | | | | | | | | | | | | | | fixes #4208 If a query selects only a few columns and gives custom names to those columns then respond_to? was returning true for the non selected columns. However calling those non selected columns raises exception. post = Post.select("'title' as post_title").first In the above case when `post.body` is invoked then an exception is raised since `body` attribute is not selected. Howevere `respond_to?` did not behave correctly. pos.respond_to?(:body) #=> true Reason was that Active Record calls `super` to pass the call to Active Model and all the columns are defined on Active Model. Fix is to actually check if the data returned from the db contains the data for column in question. | |||||
* | Fixed typos in activerecord | Prathamesh Sonpatki | 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 | |
| | ||||||
* | fix typos in AR. lots of them. | Vipul A M | 2013-03-19 | 1 | -1/+1 | |
| | ||||||
* | Keep the code related to serialization in Serialization module. | Nikita Afanasenko | 2012-11-10 | 1 | -8/+4 | |
| | | | | We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module. | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2012-11-03 | 1 | -10/+15 | |
|\ | | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md | |||||
| * | read_attribute is public [ci skip] | Francesco Rodriguez | 2012-10-21 | 1 | -1/+1 | |
| | | ||||||
| * | improve AR::AttributeMethods documentation [ci skip] | Francesco Rodriguez | 2012-10-21 | 1 | -6/+10 | |
| | | ||||||
| * | Fix AR::AttributeMethods#[] example [ci skip] | Francesco Rodriguez | 2012-10-21 | 1 | -1/+1 | |
| | | ||||||
* | | AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes. | Francesco Rodriguez | 2012-10-28 | 1 | -2/+8 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following behaviour: class Person < ActiveRecord::Base belongs_to :company end # Before: person = Person.select('id').first person[:name] # => nil person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => nil person.company # => nil # After: person = Person.select('id').first person[:name] # => ActiveModel::MissingAttributeError: missing_attribute: name person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => ActiveModel::MissingAttributeError: missing_attribute: company_id person.company # => ActiveModel::MissingAttributeError: missing_attribute: company_id Fixes #5433. | |||||
* | | Remove ActiveRecord::Model | Jon Leighton | 2012-10-26 | 1 | -1/+1 | |
|/ | | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced. | |||||
* | update AR::AttributeMethods documentation [ci skip] | Francesco Rodriguez | 2012-10-21 | 1 | -23/+124 | |
| | ||||||
* | Support for partial inserts. | Jon Leighton | 2012-09-28 | 1 | -5/+5 | |
| | | | | | | | | | | | When inserting new records, only the fields which have been changed from the defaults will actually be included in the INSERT statement. The other fields will be populated by the database. This is more efficient, and also means that it will be safe to remove database columns without getting subsequent errors in running app processes (so long as the code in those processes doesn't contain any references to the removed column). | |||||
* | load active_support/deprecation in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 | |
| | ||||||
* | no need to define methods in included hook | Jon Leighton | 2012-06-15 | 1 | -13/+13 | |
| | ||||||
* | Use each_with_object instead of each here | Santiago Pastorino | 2012-06-09 | 1 | -3/+3 | |
| | ||||||
* | Merge pull request #6687 from tiegz/3-2-optimizations | José Valim | 2012-06-09 | 1 | -1/+3 | |
| | | | | ActiveRecord#attributes optimization: minimize objects created | |||||
* | much code can be deleted thanks to @tenderlove's refactoring | Jon Leighton | 2012-03-28 | 1 | -8/+0 | |
| | ||||||
* | Merge pull request #5294 from robinroestenburg/master | Aaron Patterson | 2012-03-12 | 1 | -23/+50 | |
|\ | | | | | Refactoring of `arel_attributes_values` method | |||||
| * | Removed flag attributes. | Robin Roestenburg | 2012-03-06 | 1 | -19/+32 | |
| | | ||||||
| * | Refactored method arel_attributes_values. | Robin Roestenburg | 2012-03-06 | 1 | -20/+34 | |
| | | ||||||
* | | attribute_present? should return false for empty strings | Jacob Green | 2012-03-06 | 1 | -1/+1 | |
|/ | ||||||
* | handle id attribute in PrimaryKey module | Sergey Nartimov | 2012-02-11 | 1 | -1/+1 | |
| | ||||||
* | adding a comment for myself | Aaron Patterson | 2012-02-06 | 1 | -0/+1 | |
| | ||||||
* | Fix another race condition. | Jon Leighton | 2012-01-20 | 1 | -3/+0 | |
| | | | | | | From 2c667f69aa2daac5ee6c29ca9679616e2a71532a. Thanks @pwnall for the heads-up. | |||||
* | Fix race condition :bomb: | Jon Leighton | 2012-01-13 | 1 | -4/+11 | |
| | ||||||
* | Revert "Base#[] and Base#[]= are aliases so implement them as aliases :)" | Tom Stuart | 2012-01-11 | 1 | -4/+6 | |
| | | | | This reverts commit 21eadc1b3f2eb818a4833381ee0a6cfa205f2955. | |||||
* | Support establishing connection on ActiveRecord::Model. | Jon Leighton | 2011-12-28 | 1 | -1/+1 | |
| | | | | | This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base. | |||||
* | Ensure attribute methods are included after all the AR stuff | Jon Leighton | 2011-12-24 | 1 | -1/+1 | |
| | ||||||
* | Extract common logic into a method | Jon Leighton | 2011-12-24 | 1 | -1/+1 | |
| | ||||||
* | Fix situation where id method didn't get defined causing postgres to fail | Jon Leighton | 2011-12-23 | 1 | -4/+3 | |
| | ||||||
* | Fix #4046. | Jon Leighton | 2011-12-23 | 1 | -42/+33 | |
| | ||||||
* | remove deprecated underscore versions of attribute methods | Sergey Nartimov | 2011-12-21 | 1 | -1/+0 | |
| | ||||||
* | Let AttributeMethods do its own including etc | Jon Leighton | 2011-12-15 | 1 | -0/+23 | |
| | ||||||
* | Split out most of the AR::Base code into separate modules :cake: | Jon Leighton | 2011-12-15 | 1 | -2/+113 | |
| | ||||||
* | Use a separate module for 'external' attribute methods. | Jon Leighton | 2011-12-14 | 1 | -0/+14 | |
| | ||||||
* | Remove the need for type_cast_attribute. | Jon Leighton | 2011-12-01 | 1 | -0/+4 | |
| | | | | This is good because it reduces duplication. | |||||
* | Remove unnecessary *args | Jon Leighton | 2011-12-01 | 1 | -2/+2 | |
| | ||||||
* | Stop trying to be clever about when to define attribute methods. | Jon Leighton | 2011-09-14 | 1 | -10/+1 | |
| | | | | | | | | | There is no meaningful performance penalty in defining attribute methods, since it only happens once. There is also no reason *not* to define them, since they get thrown in an included module, so they will not 'overwrite' anything. In fact, this is desirable, since it allows us to call super. | |||||
* | We don't need to build a set for DangerousAttributeError. | Jon Leighton | 2011-09-14 | 1 | -7/+13 | |
| | | | | We can just use method_defined? and private_method_defined? | |||||
* | Deprecate using method_missing for attributes that are columns. | Jon Leighton | 2011-09-13 | 1 | -0/+15 | |
| | | | | | | This shouldn't ever happen unless people are doing something particularly weird, but adding a deprecation in case there are bugs not caught by our tests. |