aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
Commit message (Collapse)AuthorAgeFilesLines
* short arrays in inspectJan Bernacki2013-10-301-3/+10
|
* always check to see if methods exist after calling define_attribute_methodsMatt Jones2013-10-241-6/+3
|
* Use TS::Cache instead of Mutex + Hash.thedarkone2013-09-281-12/+8
| | | | TS::Cache#compute_if_absent guarantees that only a single thread will get to execute the provided block for a given key.
* Remove deprecation warning from attribute_missing Arun Agrawal2013-07-151-14/+0
| | | for attributes that are columns.
* Avoid creating an extra Range instanceAkira Matsuda2013-07-101-1/+1
|
* Fix: attribute_for_inspect truncate upto (51 => 50) characters.namusyaka2013-07-091-2/+2
|
* refactor the method cache objects to have a superclassAaron Patterson2013-07-031-0/+25
|
* move the reader method cache in to the read moduleAaron Patterson2013-07-031-48/+0
|
* keep a cache of the reader methods so we can reuse themAaron Patterson2013-07-031-0/+48
|
* freeze the constant value so it isn't duped when used as a hash keyAaron Patterson2013-07-021-1/+1
|
* stop storing multiple copies of a particular attribute nameAaron Patterson2013-07-021-12/+10
|
* eagerly assign the attribute name cache, remove const_missingAaron Patterson2013-07-021-2/+5
|
* initialize generated modules on inclusion and on inheritenceAaron Patterson2013-07-021-1/+1
|
* push attribute constant cache in to the attribute methods moduleAaron Patterson2013-07-021-1/+9
|
* lock around mutating the generated methods moduleAaron Patterson2013-07-021-2/+4
|
* remove private attribute readerAaron Patterson2013-07-021-6/+2
|
* define attribute methods in a thread safe mannerAaron Patterson2013-07-021-5/+4
|
* we don't need to use active support *everwhere* common.Aaron Patterson2013-07-021-1/+1
|
* initialize ivars so we don't have to constantly check themAaron Patterson2013-07-021-1/+3
|
* eagerly initialize the attributes module to avoid check-then-set race conditionsAaron Patterson2013-07-021-1/+12
|
* fixes a test, and explains why AR::AttributeMethods checks ↵Xavier Noria2013-04-281-0/+3
| | | | defined?(@attributes) in some places
* ActiveRecord -> Active RecordXavier Noria2013-04-251-1/+1
|
* fixes warning in the AR test suiteXavier Noria2013-04-251-1/+1
|
* if singletons belong to the contract, test themXavier Noria2013-04-201-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 columnNeeraj Singh2013-04-191-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 activerecordPrathamesh Sonpatki2013-03-271-1/+1
|
* When we pass id to update_attributes it will try to set new id for that recordDmitry Vorotilin2013-03-221-1/+1
|
* fix typos in AR. lots of them.Vipul A M2013-03-191-1/+1
|
* Keep the code related to serialization in Serialization module.Nikita Afanasenko2012-11-101-8/+4
| | | | We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-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 Rodriguez2012-10-211-1/+1
| |
| * improve AR::AttributeMethods documentation [ci skip]Francesco Rodriguez2012-10-211-6/+10
| |
| * Fix AR::AttributeMethods#[] example [ci skip]Francesco Rodriguez2012-10-211-1/+1
| |
* | AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes.Francesco Rodriguez2012-10-281-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::ModelJon Leighton2012-10-261-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 Rodriguez2012-10-211-23/+124
|
* Support for partial inserts.Jon Leighton2012-09-281-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/railsXavier Noria2012-08-021-1/+0
|
* no need to define methods in included hookJon Leighton2012-06-151-13/+13
|
* Use each_with_object instead of each hereSantiago Pastorino2012-06-091-3/+3
|
* Merge pull request #6687 from tiegz/3-2-optimizationsJosé Valim2012-06-091-1/+3
| | | | ActiveRecord#attributes optimization: minimize objects created
* much code can be deleted thanks to @tenderlove's refactoringJon Leighton2012-03-281-8/+0
|
* Merge pull request #5294 from robinroestenburg/masterAaron Patterson2012-03-121-23/+50
|\ | | | | Refactoring of `arel_attributes_values` method
| * Removed flag attributes.Robin Roestenburg2012-03-061-19/+32
| |
| * Refactored method arel_attributes_values.Robin Roestenburg2012-03-061-20/+34
| |
* | attribute_present? should return false for empty stringsJacob Green2012-03-061-1/+1
|/
* handle id attribute in PrimaryKey moduleSergey Nartimov2012-02-111-1/+1
|
* adding a comment for myselfAaron Patterson2012-02-061-0/+1
|
* Fix another race condition.Jon Leighton2012-01-201-3/+0
| | | | | | From 2c667f69aa2daac5ee6c29ca9679616e2a71532a. Thanks @pwnall for the heads-up.
* Fix race condition :bomb:Jon Leighton2012-01-131-4/+11
|