aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
Commit message (Collapse)AuthorAgeFilesLines
* scope_chain should not be mutated for other reflectionsNeeraj Singh2013-10-141-1/+1
| | | | | | | | | | | Currently `scope_chain` uses same array for building different `scope_chain` for different associations. During processing these arrays are sometimes mutated and because of in-place mutation the changed `scope_chain` impacts other reflections. Fix is to dup the value before adding to the `scope_chain`. Fixes #3882.
* Fix the indentationRafael Mendonça França2013-10-081-12/+13
|
* remove HABTM special cases from reflectionsAaron Patterson2013-10-021-14/+2
|
* push constructable? on to the reflectionAaron Patterson2013-10-021-0/+16
|
* Remove conditional adding a new methodRafael Mendonça França2013-09-111-5/+5
| | | | | | At the point we want to add the reflection we already know the reflection is of the AggregateReflection type so we can call a specific method
* support anonymous classes on has_many associationsAaron Patterson2013-09-031-0/+1
|
* pk should not be required for hm:t associationsAaron Patterson2013-08-291-1/+0
|
* Fixing multi-word automatic inverse detection.wangjohn2013-08-151-2/+2
| | | | | Currently, ActiveRecord models with multiple words cannot have their inverse associations detected automatically.
* Revert "all `scope_chain` methods allocate new arrays, no need to dup"Aaron Patterson2013-07-311-1/+1
| | | | This reverts commit 1468a4b89aa4bca99160bfa03572b2c0ab348db5.
* all `scope_chain` methods allocate new arrays, no need to dupAaron Patterson2013-07-301-1/+1
|
* oops!Aaron Patterson2013-07-231-1/+1
|
* eliminate conditional in JoinHelperAaron Patterson2013-07-231-1/+1
|
* acually get the actual source reflection :cry::gun:Aaron Patterson2013-07-231-7/+14
|
* factory methods should not have side effects.Aaron Patterson2013-07-231-3/+1
| | | | Move model mutation to the methods that are called on the model.
* extract mutation from generation methodAaron Patterson2013-07-231-3/+5
|
* habtm can only ever be an association reflectionAaron Patterson2013-07-221-2/+4
|
* use the predicate methodAaron Patterson2013-07-221-1/+1
|
* AR::Base does not need to know how to create reflection objectsAaron Patterson2013-07-221-19/+19
|
* use the superclass implementationAaron Patterson2013-07-181-1/+3
|
* quoted table name is also cachedAaron Patterson2013-06-131-1/+1
|
* table name is cached on the class, so stop caching twiceAaron Patterson2013-06-131-1/+1
|
* calculate types on constructionAaron Patterson2013-06-131-8/+4
|
* only cache the primary key column in one placeAaron Patterson2013-06-131-1/+1
|
* these methods are never called, so remove themAaron Patterson2013-06-131-8/+0
|
* This test does not test anything that happens in the real world. If youAaron Patterson2013-06-131-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recreate the models without mucking with internal caches of the relation objects, then the test fails. For example: class Man < ActiveRecord::Base has_many :interests end class Interest < ActiveRecord::Base belongs_to :man end Then do this test: def test_validate_presence_of_parent_fails_without_inverse_of repair_validations(Interest) do Interest.validates_presence_of(:man) assert_no_difference ['Man.count', 'Interest.count'] do man = Man.create(:name => 'John', :interests_attributes => [{:topic=>'Cars'}, {:topic=>'Sports'}]) assert_not_predicate man.errors[:"interests.man"], :empty? end end end The test will fail. This is a bad test, so I am removing it.
* oops. step away from the keyboard aaron. :cry:Aaron Patterson2013-06-131-1/+1
|
* fix caching of automatic inverse of. :bomb:Aaron Patterson2013-06-131-1/+3
|
* let the object stay in charge of internal cache invalidationAaron Patterson2013-06-131-7/+5
|
* reduce automatic_inverse_of caching logicAaron Patterson2013-06-131-30/+16
|
* active_record should always be set. Do or do not, there is no tryAaron Patterson2013-06-131-1/+1
|
* push ambiguous reflection warning down to reflection name calculationAaron Patterson2013-06-131-23/+28
|
* clean up ivar assignmentAaron Patterson2013-06-131-3/+2
|
* Ambiguous reflections are on :through relationships are no longer supported.Aaron Patterson2013-06-131-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, you need to change this: class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end To this: class Author < ActiveRecord::Base has_many :posts has_many :taggings, :through => :posts, :source => :tagging end class Post < ActiveRecord::Base has_one :tagging has_many :taggings end class Tagging < ActiveRecord::Base end
* sometimes singularize does not work, so we get a list of two strings. just ↵Aaron Patterson2013-06-121-1/+1
| | | | uniq them
* no need to cache hash lookupsAaron Patterson2013-06-121-1/+1
|
* split aggregates from association reflections to avoid is_a checks laterAaron Patterson2013-06-121-5/+11
|
* remove unnecessary is_a checkAaron Patterson2013-06-121-2/+1
|
* Getting rid of the +automatic_inverse_of: false+ option in associations in favorwangjohn2013-06-081-7/+7
| | | | | of using +inverse_of: false+ option. Changing the documentation and adding a CHANGELOG entry for the automatic inverse detection feature.
* remove code duplicationNeeraj Singh2013-05-221-2/+3
|
* Some editorial changes on the documentation.Rafael Mendonça França2013-05-121-4/+4
| | | | | | | | * Remove some autolinks * Fix the rendered result * Change sql to SQL [ci skip]
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-05-121-4/+4
|\ | | | | | | | | Conflicts: activesupport/lib/active_support/callbacks.rb
| * minor rdoc cleanup for reflection methodsNeeraj Singh2013-05-091-4/+4
| |
* | Adding documentation to the automatic inverse_of finder.wangjohn2013-05-111-1/+1
| |
* | Created a method to automatically find inverse associations and cachewangjohn2013-05-071-3/+98
|/ | | | | | the results. Added tests to check to make sure that inverse associations are automatically found when has_many, has_one, or belongs_to associations are defined.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-04-111-1/+6
|\ | | | | | | | | Conflicts: guides/source/action_mailer_basics.md
| * minor copy editingNeeraj Singh2013-03-301-1/+6
| |
* | Use a space after the comment sign when showing the result of commandsCarlos Antonio da Silva2013-04-041-4/+4
| | | | | | | | | | | | http://guides.rubyonrails.org/api_documentation_guidelines.html#example-code [ci skip]
* | expanded rdoc for chain and reflection_namesNeeraj Singh2013-04-041-2/+20
| |
* | expanded rdoc on source_reflection methodNeeraj Singh2013-04-041-0/+10
|/
* Refactor to use each_key, remove extra spacesCarlos Antonio da Silva2013-01-281-1/+0
|