Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | eliminate conditional in JoinHelper | Aaron Patterson | 2013-07-23 | 1 | -1/+1 | |
| | ||||||
* | acually get the actual source reflection :cry::gun: | Aaron Patterson | 2013-07-23 | 1 | -7/+14 | |
| | ||||||
* | factory methods should not have side effects. | Aaron Patterson | 2013-07-23 | 1 | -3/+1 | |
| | | | | Move model mutation to the methods that are called on the model. | |||||
* | extract mutation from generation method | Aaron Patterson | 2013-07-23 | 1 | -3/+5 | |
| | ||||||
* | habtm can only ever be an association reflection | Aaron Patterson | 2013-07-22 | 1 | -2/+4 | |
| | ||||||
* | use the predicate method | Aaron Patterson | 2013-07-22 | 1 | -1/+1 | |
| | ||||||
* | AR::Base does not need to know how to create reflection objects | Aaron Patterson | 2013-07-22 | 1 | -19/+19 | |
| | ||||||
* | use the superclass implementation | Aaron Patterson | 2013-07-18 | 1 | -1/+3 | |
| | ||||||
* | quoted table name is also cached | Aaron Patterson | 2013-06-13 | 1 | -1/+1 | |
| | ||||||
* | table name is cached on the class, so stop caching twice | Aaron Patterson | 2013-06-13 | 1 | -1/+1 | |
| | ||||||
* | calculate types on construction | Aaron Patterson | 2013-06-13 | 1 | -8/+4 | |
| | ||||||
* | only cache the primary key column in one place | Aaron Patterson | 2013-06-13 | 1 | -1/+1 | |
| | ||||||
* | these methods are never called, so remove them | Aaron Patterson | 2013-06-13 | 1 | -8/+0 | |
| | ||||||
* | This test does not test anything that happens in the real world. If you | Aaron Patterson | 2013-06-13 | 1 | -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 Patterson | 2013-06-13 | 1 | -1/+1 | |
| | ||||||
* | fix caching of automatic inverse of. :bomb: | Aaron Patterson | 2013-06-13 | 1 | -1/+3 | |
| | ||||||
* | let the object stay in charge of internal cache invalidation | Aaron Patterson | 2013-06-13 | 1 | -7/+5 | |
| | ||||||
* | reduce automatic_inverse_of caching logic | Aaron Patterson | 2013-06-13 | 1 | -30/+16 | |
| | ||||||
* | active_record should always be set. Do or do not, there is no try | Aaron Patterson | 2013-06-13 | 1 | -1/+1 | |
| | ||||||
* | push ambiguous reflection warning down to reflection name calculation | Aaron Patterson | 2013-06-13 | 1 | -23/+28 | |
| | ||||||
* | clean up ivar assignment | Aaron Patterson | 2013-06-13 | 1 | -3/+2 | |
| | ||||||
* | Ambiguous reflections are on :through relationships are no longer supported. | Aaron Patterson | 2013-06-13 | 1 | -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 Patterson | 2013-06-12 | 1 | -1/+1 | |
| | | | | uniq them | |||||
* | no need to cache hash lookups | Aaron Patterson | 2013-06-12 | 1 | -1/+1 | |
| | ||||||
* | split aggregates from association reflections to avoid is_a checks later | Aaron Patterson | 2013-06-12 | 1 | -5/+11 | |
| | ||||||
* | remove unnecessary is_a check | Aaron Patterson | 2013-06-12 | 1 | -2/+1 | |
| | ||||||
* | Getting rid of the +automatic_inverse_of: false+ option in associations in favor | wangjohn | 2013-06-08 | 1 | -7/+7 | |
| | | | | | of using +inverse_of: false+ option. Changing the documentation and adding a CHANGELOG entry for the automatic inverse detection feature. | |||||
* | remove code duplication | Neeraj Singh | 2013-05-22 | 1 | -2/+3 | |
| | ||||||
* | Some editorial changes on the documentation. | Rafael Mendonça França | 2013-05-12 | 1 | -4/+4 | |
| | | | | | | | | * Remove some autolinks * Fix the rendered result * Change sql to SQL [ci skip] | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2013-05-12 | 1 | -4/+4 | |
|\ | | | | | | | | | Conflicts: activesupport/lib/active_support/callbacks.rb | |||||
| * | minor rdoc cleanup for reflection methods | Neeraj Singh | 2013-05-09 | 1 | -4/+4 | |
| | | ||||||
* | | Adding documentation to the automatic inverse_of finder. | wangjohn | 2013-05-11 | 1 | -1/+1 | |
| | | ||||||
* | | Created a method to automatically find inverse associations and cache | wangjohn | 2013-05-07 | 1 | -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/docrails | Vijay Dev | 2013-04-11 | 1 | -1/+6 | |
|\ | | | | | | | | | Conflicts: guides/source/action_mailer_basics.md | |||||
| * | minor copy editing | Neeraj Singh | 2013-03-30 | 1 | -1/+6 | |
| | | ||||||
* | | Use a space after the comment sign when showing the result of commands | Carlos Antonio da Silva | 2013-04-04 | 1 | -4/+4 | |
| | | | | | | | | | | | | http://guides.rubyonrails.org/api_documentation_guidelines.html#example-code [ci skip] | |||||
* | | expanded rdoc for chain and reflection_names | Neeraj Singh | 2013-04-04 | 1 | -2/+20 | |
| | | ||||||
* | | expanded rdoc on source_reflection method | Neeraj Singh | 2013-04-04 | 1 | -0/+10 | |
|/ | ||||||
* | Refactor to use each_key, remove extra spaces | Carlos Antonio da Silva | 2013-01-28 | 1 | -1/+0 | |
| | ||||||
* | Added STI support to init and building associations | Jason Rush | 2012-11-29 | 1 | -1/+1 | |
| | | | | | | | | Allows you to do BaseClass.new(:type => "SubClass") as well as parent.children.build(:type => "SubClass") or parent.build_child to initialize an STI subclass. Ensures that the class name is a valid class and that it is in the ancestors of the super class that the association is expecting. | |||||
* | Another batch of hash syntax changes to comment, this time around, I tried ↵ | AvnerCohen | 2012-10-23 | 1 | -12/+12 | |
| | | | | to keep 'output' messages untouched. | |||||
* | Remove mass_assignment_options from ActiveRecord | Guillermo Iguaran | 2012-09-16 | 1 | -2/+2 | |
| | ||||||
* | Refactor to remove some duplication | Jon Leighton | 2012-09-12 | 1 | -0/+4 | |
| | ||||||
* | load active_support/core_ext/class/attribute in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 | |
| | ||||||
* | load active_support/core_ext/object/inclusion in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 | |
| | ||||||
* | Revert "Removing composed_of from ActiveRecord." | Rafael Mendonça França | 2012-07-27 | 1 | -5/+40 | |
| | | | | | | | | | | | 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 | |||||
* | remove unused method | Jon Leighton | 2012-07-20 | 1 | -4/+0 | |
| | ||||||
* | Represent association scope options as AR::Relations insternally. | Jon Leighton | 2012-07-13 | 1 | -19/+15 | |
| | ||||||
* | Allow associations to take a lambda which builds the scope | Jon Leighton | 2012-07-13 | 1 | -4/+7 | |
| | ||||||
* | Improve the derivation of HABTM assocation join table names | Andrew White | 2012-06-22 | 1 | -0/+16 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the derivation of HABTM join table name to take account of nesting. It now takes the table names of the two models, sorts them lexically and then joins them, stripping any common prefix from the second table name. Some examples: Top level models (Category <=> Product) Old: categories_products New: categories_products Top level models with a global table_name_prefix (Category <=> Product) Old: site_categories_products New: site_categories_products Nested models in a module without a table_name_prefix method (Admin::Category <=> Admin::Product) Old: categories_products New: categories_products Nested models in a module with a table_name_prefix method (Admin::Category <=> Admin::Product) Old: categories_products New: admin_categories_products Nested models in a parent model (Catalog::Category <=> Catalog::Product) Old: categories_products New: catalog_categories_products Nested models in different parent models (Catalog::Category <=> Content::Page) Old: categories_pages New: catalog_categories_content_pages Also as part of this commit the validity checks for HABTM assocations have been moved to ActiveRecord::Reflection One side effect of this is to move when the exceptions are raised from the point of declaration to when the association is built. This is consistant with other association validity checks. |