aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/aggregations.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Removing composed_of from ActiveRecord."Rafael Mendonça França2012-07-271-0/+261
| | | | | | | | | | | This reverts commit 14fc8b34521f8354a17e50cd11fa3f809e423592. Reason: we need to discuss a better path from this removal. Conflicts: activerecord/lib/active_record/reflection.rb activerecord/test/cases/base_test.rb activerecord/test/models/developer.rb
* Removing composed_of from ActiveRecord.Steve Klabnik2012-06-181-261/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature adds a lot of complication to ActiveRecord for dubious value. Let's talk about what it does currently: class Customer < ActiveRecord::Base composed_of :balance, :class_name => "Money", :mapping => %w(balance amount) end Instead, you can do something like this: def balance @balance ||= Money.new(value, currency) end def balance=(balance) self[:value] = balance.value self[:currency] = balance.currency @balance = balance end Since that's fairly easy code to write, and doesn't need anything extra from the framework, if you use composed_of today, you'll have to add accessors/mutators like that. Closes #1436 Closes #2084 Closes #3807
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-231-3/+3
|\
| * Revert "Remove blank trailing comments"Vijay Dev2012-05-231-0/+2
| | | | | | | | | | | | | | | | | | | | This reverts commit fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a. Reason: Not a fan of such massive changes. We usually close such changes if made to Rails master as a pull request. Following the same principle here and reverting. [ci skip]
| * Remove blank trailing commentsHenrik Hodne2012-05-201-2/+0
| | | | | | | | | | | | | | For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace with the first match, and voilà! Note that the regex matches a little bit too much, so you probably want to `git add -i .` and go through every single diff to check if it actually should be changed.
| * Revert typoOscar Del Ben2012-05-191-1/+1
| |
| * TypoOscar Del Ben2012-05-191-4/+4
| |
* | Refactor aggregation writer methodCarlos Antonio da Silva2012-05-211-4/+3
| | | | | | | | Only constantize class_name once.
* | Merge pull request #6143 from senny/composed_of_converter_returns_nilAaron Patterson2012-05-211-7/+8
|\ \ | |/ |/| allow the :converter Proc form composed_of to return nil
| * allow the :converter Proc form composed_of to return nilYves Senn2012-05-031-7/+8
| | | | | | | | | | | | | | This makes it possible to filter invalid input values before they are passed into the value-object (like empty strings). This behaviour is only relevant if the :allow_nil options is set to true. Otherwise you will get the resulting NoMethodError.
* | missing 'with'Hrvoje Šimić2012-05-111-1/+1
| |
* | Add empty rows to improve readability. [ci skip]Edward Tsech2012-05-011-0/+2
| |
* | Add few lines to describe how aggregation part caching works. [ci skip]Edward Tsech2012-05-011-0/+4
| |
* | simpler wording and explanationsHrvoje Šimić2012-05-011-3/+3
| |
* | Fixed typo in composed_of example with Money#<=>, was comparing amount ↵Noah Hendrix2012-02-241-1/+1
| | | | | | | | itself instead of other_money.amount
* | minor fixes in the composed_of docVijay Dev2011-10-221-3/+4
| |
* | Remove extra white spaces on ActiveRecord docs.Sebastian Martinez2011-05-231-1/+1
|/
* remove unnecessary module_evalAaron Patterson2011-01-181-25/+20
|
* send() will raise an ArgumentError, so we should leverage rubyAaron Patterson2011-01-071-16/+6
|
* no need for parensAaron Patterson2011-01-071-1/+1
|
* use a hash for caching aggregations rather than ivarsAaron Patterson2011-01-071-12/+6
|
* method is never called with argumentsAaron Patterson2011-01-071-4/+2
|
* use persisted? instead of new_record? wherever possibleDavid Chelimsky2010-11-091-1/+1
| | | | | | | | | | | - 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>
* Use new finders syntax in docs.Emilio Tagua2010-09-011-1/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-48/+48
| | | | 's/[ \t]*$//' -i {} \;)
* ensuring that documentation does not exceed 100 columnsNeeraj Singh2010-08-011-7/+6
|
* ensuring that documentation does not exceed 100 columnsNeeraj Singh2010-07-311-51/+65
|
* Remove deprecated block usage in composed_of.Emilio Tagua2010-06-241-4/+2
|
* Adds title and basic description where needed.Rizwan Reza2010-06-151-0/+1
|
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-0/+1
|
* fisting uninitialized ivar warnings. [#4198 state:resolved]Aaron Patterson2010-03-161-0/+5
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Break up DependencyModule's dual function of providing a "depend_on" DSL and ↵Joshua Peek2009-05-281-1/+1
| | | | "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
* Use DependencyModule for included hooks in ActiveRecordBryan Helmkamp2009-05-111-3/+1
|
* Merge docrailsPratik Naik2008-10-051-2/+2
|
* Expanded documentation for new composed_of optionsRob Anderton2008-09-101-10/+53
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#892 state:committed]
* Added :constructor and :converter options to composed_of and deprecated the ↵Rob Anderton2008-09-101-31/+60
| | | | | | conversion block Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Merge docrails.Pratik Naik2008-05-251-9/+9
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Partial updates include only unsaved attributes. Off by default; set ↵Jeremy Kemper2008-03-311-2/+2
| | | | | | YourClass.partial_updates = true to enable. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Support aggregations in finder conditions. Closes #10572.Jeremy Kemper2008-01-191-0/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8671 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: introduce ActiveSupport::FrozenObjectError normalize ↵Jeremy Kemper2007-12-291-1/+1
| | | | | | TypeError vs RuntimeError handling. Closes #10645 [Frederick Cheung] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: workaround module_eval bug. Closes #10641 [Frederick Cheung]Jeremy Kemper2007-12-291-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8507 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix typos (closes #10378)David Heinemeier Hansson2007-12-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Assigning an instance of a foreign class to a composed_of aggregate calls an ↵Jeremy Kemper2007-10-231-37/+26
| | | | | | optional conversion block. Refactor and simplify composed_of implementation. Closes #6322. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8003 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Assigning nil to a composed_of aggregate also sets its immediate value to ↵Jeremy Kemper2007-10-231-2/+2
| | | | | | nil. Closes #9843. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8002 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* eval with __FILE__ and __LINE__Jeremy Kemper2007-10-101-5/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7827 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Formatting, grammar and spelling fixes for the associations documentation. ↵Michael Koziarski2007-08-281-11/+11
| | | | | | [seanhussey] Closes #8899 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7368 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Backed out of new_record? to new? transformation as it would screw up ↵David Heinemeier Hansson2006-09-051-1/+1
| | | | | | existing models that did boolean calls on "new" attributes [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated ActiveRecord::Base.new_record? in favor of ↵David Heinemeier Hansson2006-09-051-1/+1
| | | | | | ActiveRecord::Base.new? (old version still works until Rails 2.0) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Grammar fix in aggregations rdoc. Closes #5613.Jeremy Kemper2006-07-061-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4561 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :allow_nil option for aggregations (closes #5091) [ian.w.white@gmail.com]David Heinemeier Hansson2006-05-211-16/+43
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de