Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Failing test for aggregating on default_scope with select | Erik Fonselius | 2011-05-31 | 1 | -0/+5 |
| | |||||
* | Tests for issue #1360 | Farley Knight | 2011-05-31 | 1 | -0/+15 |
| | |||||
* | Fix infinite recursion where a lazy default scope references a scope. Fixes ↵ | Jon Leighton | 2011-05-25 | 1 | -0/+15 |
| | | | | #1264. | ||||
* | Merge pull request #1254 from pixeltrix/ignore-includes-in-through-scope | Jon Leighton | 2011-05-24 | 2 | -0/+9 |
|\ | | | | | Ignore :includes on through associations | ||||
| * | Ignore :includes on through associations | Andrew White | 2011-05-24 | 2 | -0/+9 |
| | | |||||
* | | Failing tests for #1233. | Andrew White | 2011-05-24 | 1 | -0/+35 |
|/ | |||||
* | Refactoring test_has_many_with_pluralize_table_names_false test | Guillermo Iguaran | 2011-05-20 | 1 | -0/+1 |
| | |||||
* | Pass the attribute and option hashes to build_association | Andrew White | 2011-05-17 | 1 | -0/+13 |
| | | | | | | | The build_association method was added as an API for plugins to hook into in 1398db0. This commit restores this API and the ability to override class.new to return a subclass based on a virtual attribute in the attributes hash. | ||||
* | Merge pull request #560 from guilleiguaran/fix_pluralize_table_names_false | Jon Leighton | 2011-05-16 | 1 | -0/+3 |
|\ | | | | | Fixing has_many when ActiveRecord::Base.pluralize_table_names is false | ||||
| * | Fixing has_many association when ActiveRecord::Base.pluralize_table_names is ↵ | Guillermo Iguaran | 2011-05-15 | 1 | -0/+3 |
| | | | | | | | | false. fixes #557 | ||||
* | | CollectionAssociation#merge_target_lists should write to the underlying ↵ | Jon Leighton | 2011-05-14 | 1 | -0/+4 |
|/ | | | | attributes when copying, rather than using the assignment method | ||||
* | Don't use mass-assignment protection when setting foreign keys or ↵ | Jon Leighton | 2011-05-12 | 1 | -0/+3 |
| | | | | association conditions on singular associations. Fixes #481 (again). | ||||
* | Don't use select() values from the join model of a through association. ↵ | Jon Leighton | 2011-05-11 | 2 | -0/+8 |
| | | | | Fixes #508. | ||||
* | Add test to specify that attributes from an association's conditions should ↵ | Jon Leighton | 2011-05-10 | 2 | -0/+4 |
| | | | | be assigned without mass-assignment protection when a record is built on the association. | ||||
* | Don't quote ID's as Arel will quote them -- follow same conventions as the ↵ | Christopher Meiklejohn | 2011-05-08 | 1 | -0/+3 |
| | | | | delete method. | ||||
* | Merge pull request #357 from joshk/assign_attributes. | David Heinemeier Hansson | 2011-05-01 | 1 | -6/+17 |
|\ | | | | | Assign protected attributes with create/new and control the role. | ||||
| * | singular and collection relations in AR can now specify mass-assignment ↵ | Josh Kalderimis | 2011-05-01 | 1 | -6/+17 |
| | | | | | | | | security options (:as and :without_protection) in build, create and create! methods. | ||||
* | | removed the default_scope deprecations and updated the docs and tests to ↵ | Josh Kalderimis | 2011-04-28 | 1 | -6/+18 |
|/ | | | | reflect its use cases | ||||
* | Added assign_attributes to Active Record which accepts a mass-assignment ↵ | Josh Kalderimis | 2011-04-24 | 2 | -24/+19 |
| | | | | security scope using the :as option, while also allowing mass-assignment security to be bypassed using :with_protected | ||||
* | Bring back support for passing a callable object to the default_scope macro. ↵ | Jon Leighton | 2011-04-18 | 1 | -0/+17 |
| | | | | You can also just use a block. | ||||
* | Un-deprecate using 'default_scope' as a macro, but if you are calling the ↵ | Jon Leighton | 2011-04-18 | 7 | -77/+23 |
| | | | | macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times. | ||||
* | Revert "Deprecate defining scopes with a callable (lambda, proc, etc) via ↵ | Jon Leighton | 2011-04-17 | 3 | -30/+21 |
| | | | | | | | | | | the scope class method. Just define a class method yourself instead." This reverts commit f0e198bfa1e3f9689e0cde1d194a44027fc90b3c. Conflicts: activerecord/test/models/post.rb | ||||
* | common @jonleighton :bomb: | Aaron Patterson | 2011-04-12 | 1 | -2/+1 |
| | |||||
* | Deprecate defining scopes with a callable (lambda, proc, etc) via the scope ↵ | Jon Leighton | 2011-04-12 | 3 | -21/+32 |
| | | | | class method. Just define a class method yourself instead. | ||||
* | Evaluate default scopes at the last possible moment in order to avoid ↵ | Jon Leighton | 2011-04-12 | 1 | -0/+2 |
| | | | | problems with default scopes getting included into other scopes and then being unable to remove the default part via unscoped. | ||||
* | Deprecated support for passing hashes and relations to default_scope, in ↵ | Jon Leighton | 2011-04-12 | 8 | -23/+102 |
| | | | | favour of defining a 'default_scope' class method in the model. See the CHANGELOG for more details. | ||||
* | oracle, y u defy me | Jon Leighton | 2011-03-16 | 3 | -7/+9 |
| | |||||
* | Add a test for STI on the through where the through is nested, and change ↵ | Jon Leighton | 2011-03-05 | 2 | -0/+2 |
| | | | | the code which support this | ||||
* | Merge branch 'master' into nested_has_many_through | Jon Leighton | 2011-03-04 | 26 | -35/+225 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb | ||||
| * | Rewrote AssociationPreload. | Jon Leighton | 2011-02-28 | 1 | -1/+2 |
| | | |||||
| * | Allow building and then later saving has_many :through records, such that ↵ | Jon Leighton | 2011-02-18 | 3 | -1/+5 |
| | | | | | | | | the join record is automatically saved too. This requires the :inverse_of option to be set on the source association in the join model. See the CHANGELOG for details. [#4329 state:resolved] | ||||
| * | Ensure that association_ids uses the correct attribute where the association ↵ | Jon Leighton | 2011-02-18 | 1 | -0/+1 |
| | | | | | | | | is a has_many :through with a :primary_key option on the source reflection. [#6376 state:resolved] | ||||
| * | Add interpolation of association conditions back in, in the form of proc { ↵ | Jon Leighton | 2011-02-14 | 4 | -17/+23 |
| | | | | | | | | ... } rather than instance_eval-ing strings | ||||
| * | make set_table_name take effect immediately | Jan | 2011-02-08 | 1 | -0/+4 |
| | | |||||
| * | Correctly update counter caches on deletion for has_many :through [#2824 ↵ | Jon Leighton | 2011-02-07 | 1 | -0/+5 |
| | | | | | | | | state:resolved]. Also fixed a bunch of other counter cache bugs in the process, as once I fixed this one others started appearing like nobody's business. | ||||
| * | Support the :dependent option on has_many :through associations. For ↵ | Jon Leighton | 2011-02-07 | 2 | -1/+38 |
| | | | | | | | | historical and practical reasons, :delete_all is the default deletion strategy employed by association.delete(*records), despite the fact that the default strategy is :nullify for regular has_many. Also, this only works at all if the source reflection is a belongs_to. For other situations, you should directly modify the through association. | ||||
| * | Fixing ordering of HABTM association deletion [#6191 state:resolved] | Edward Faulkner | 2011-02-04 | 2 | -0/+14 |
| | | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
| * | introduce a fake AR adapter for mocking database return values | Aaron Patterson | 2011-02-04 | 1 | -5/+7 |
| | | |||||
| * | share column cache among subclasses, only look up columns per AR::Base ↵ | Aaron Patterson | 2011-02-01 | 1 | -0/+4 |
| | | | | | | | | subclass once | ||||
| * | Propagate association extensions to scopes called on the association. | Glenn Vanderburg | 2011-02-01 | 1 | -0/+1 |
| | | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
| * | Has many through - It is not necessary to manually merge in the conditions ↵ | Jon Leighton | 2011-01-30 | 2 | -1/+5 |
| | | | | | | | | hash for the through record, because the creation is done directly on the through association, which will already handle setting the conditions. | ||||
| * | We shouldn't be using scoped.scoping { ... } to build associated records, as ↵ | Jon Leighton | 2011-01-30 | 2 | -2/+11 |
| | | | | | | | | this can affect validations/callbacks/etc inside the record itself [#6252 state:resolved] | ||||
| * | belongs_to records should be initialized within the association scope | Jon Leighton | 2011-01-16 | 1 | -0/+1 |
| | | |||||
| * | Add create_association! for belongs_to | Jon Leighton | 2011-01-16 | 1 | -0/+1 |
| | | |||||
| * | DRY up the code which instantiates the association proxy | Jon Leighton | 2011-01-11 | 2 | -0/+11 |
| | | |||||
| * | has_one should always remove the old record (properly), even if not saving ↵ | Jon Leighton | 2011-01-11 | 1 | -0/+4 |
| | | | | | | | | the new record, so we don't get the database into a pickle | ||||
| * | Fix polymorphic belongs_to associationproxy raising errors when loading target. | Ernie Miller | 2011-01-11 | 1 | -0/+2 |
| | | |||||
| * | Construct an actual ActiveRecord::Relation object for the association scope, ↵ | Jon Leighton | 2011-01-07 | 1 | -1/+0 |
| | | | | | | | | rather than a hash which is passed to apply_finder_options. This allows more flexibility in how the scope is created, for example because scope.where(a, b) and scope.where(a).where(b) mean different things. | ||||
| * | send() will raise an ArgumentError, so we should leverage ruby | Aaron Patterson | 2011-01-07 | 1 | -1/+1 |
| | | |||||
| * | Let AssociationCollection#find use #scoped to do its finding. Note that I am ↵ | Jon Leighton | 2011-01-03 | 3 | -1/+10 |
| | | | | | | | | removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences. |