Skip to content

Active Resource Associations #68

Closed
wants to merge 83 commits into from

2 participants

@gramos
gramos commented Oct 5, 2010

Related to this post:
http://groups.google.com/group/rubyonrails-core/browse_thread/thread/15d57967f94c5561

I added a basic first version of associations to Active Resource, it try follow the same behaviour than Active Record, at the moment it support only one-to-one and one-to-many associations, I'll be happy to continue working on this.

Gastón Ramos

gramos added some commits Sep 27, 2010
@gramos gramos - added associations module
- added asociations unit test file
eba7283
@gramos gramos - added first version of ActiveResource has_one associaion method b51021a
@gramos gramos - Active Resrource associations, has one should return the associated…
… resource
0453767
@gramos gramos - fix ActiveResource has_one association
  resource_id column is on the associated resource (belogns_to)
- refactoring association test cases
2d24016
@gramos gramos - remove instance variable warnings 97be04d
@gramos gramos - ActiveResource has_one association
  test_accessor_should_return_nil_when_the_does_not_has_an_associated_resource
a973713
@gramos gramos - Active Resource has_one association
  test_should_assign_a_new_project_manager
baa4749
@gramos gramos - tiny refactoring, remove duplication 78e6aec
@gramos gramos - added belongs_to association to ActiveResource 5c8eb17
@gramos gramos - ActiveResource test_belongs_to_accessor_should_return_the_associate…
…d_project
ceeb095
@gramos gramos - Active Resource
  test_belongs_to_accessor_should_return_nil_when_the_does_not_has_an_associated_resource
505318e
@gramos gramos - Active Resource associations refactoring
  * Added method set_resource_instance_variable(resource)
  * added modules InstanceMethods and ClassMethods
  * include instead of extend in ActiveResource::Base
1adb08e
@gramos gramos - added ActiveResource has_many association 1750410
@gramos gramos - fix missing old way to set resource instance variable b952f78
@gramos gramos - ActiveResource added writter to belongs_to association 1bb8bca
@gramos gramos - ActiveResource associations, added some comments 408d2f4
@gramos gramos - ActiveResource association remove :class_name option
  is not implemented yet
36760ea
@gramos gramos - ActiveResource Associations, better name for hash_options d9cfff5
@gramos gramos - ActiveResource, only constantize the resource class
  when is used it.
74bfd33
@gramos gramos - ActiveResource assocition belongs_to dont save the obj. 0d9dd48
@gramos gramos - ActiveResource added
  test_has_many_accessor_should_return_the_an_array_with_the_associated_milestones
11b8d2c
@gramos gramos - ActiveResource
  test_has_many_accessor_should_return_the_an_empty_array_when_it_does_not_has_milestones
cba1f8b
@gramos gramos - Active Resource associations, refactoring remove some duplication 2a78944
@gramos gramos - ActiveResource associaions
  test_has_many_accessor_should_return_the_an_array_including_the_added_obj
7e367a1
@gramos gramos Active Resource has_many association, change eval by instance_eval 8e013a6
@gramos gramos - Active Resource associations, dont need send with eval c878c23
@gramos gramos - ActiveResoruce association added method delete to has_many
  association
b896b8b
@gramos gramos - ActiveResource added clear method to has_many association 3055242
@gramos gramos - Active Resource Fix has_many association, update resource list
  after some methods
b43fdbe
@gramos gramos - ActiveResource association has_many, added method resource= 145cbf3
@gramos gramos - ActiveResource association has_many fix resource=
  should set an array with the added methods
17fc234
@gramos gramos - added ActiveResoruce::Associations::AssociationCollection
  move all related methods to this new class
147513d
@gramos gramos - ActiveResource::Associosiations::AssociationCollection, added missi…
…ng file
60b71ae
@gramos gramos - some changes about coding style 0b9a978
@gramos gramos - ActiveResource::Associations, simple cache added (like AR)
  project.milestones             # fetches milestones
  project.milestones.size        # uses the milestone cache
  project.milestones(true).size  # fetches milestones
1467e28
@gramos gramos - added documentation for ActiveResource::Associations def16ea
@gramos gramos - added cache doc ActiveResource::Associations 55d3daf
@gramos gramos - ActiveResource::Associations, update doc. b19981c
@gramos gramos - ActiveResource::Associations, fix some typo error in doc
- tiny fix in set_resource_instance_variable
8983092
@gramos gramos - ActiveResource::Associations, added doc for has_one c74a7b8
@gramos gramos - ActiveResource::Associations, Fix doc 266ee6c
@gramos gramos - added associations module
- added asociations unit test file
1457b37
@gramos gramos - added first version of ActiveResource has_one associaion method 2dac210
@gramos gramos - Active Resrource associations, has one should return the associated…
… resource
ef39843
@gramos gramos - fix ActiveResource has_one association
  resource_id column is on the associated resource (belogns_to)
- refactoring association test cases
7d6a21d
@gramos gramos - remove instance variable warnings f196b45
@gramos gramos - ActiveResource has_one association
  test_accessor_should_return_nil_when_the_does_not_has_an_associated_resource
dae96a2
@gramos gramos - Active Resource has_one association
  test_should_assign_a_new_project_manager
72258da
@gramos gramos - tiny refactoring, remove duplication bd82c4f
@gramos gramos - added belongs_to association to ActiveResource 60d3a6b
@gramos gramos - ActiveResource test_belongs_to_accessor_should_return_the_associate…
…d_project
1b20cbe
@gramos gramos - Active Resource
  test_belongs_to_accessor_should_return_nil_when_the_does_not_has_an_associated_resource
9295fb0
@gramos gramos - Active Resource associations refactoring
  * Added method set_resource_instance_variable(resource)
  * added modules InstanceMethods and ClassMethods
  * include instead of extend in ActiveResource::Base
db1573d
@gramos gramos - added ActiveResource has_many association 85f67da
@gramos gramos - fix missing old way to set resource instance variable dd5c268
@gramos gramos - ActiveResource added writter to belongs_to association bfabf7f
@gramos gramos - ActiveResource associations, added some comments 2798f73
@gramos gramos - ActiveResource association remove :class_name option
  is not implemented yet
09f8658
@gramos gramos - ActiveResource Associations, better name for hash_options 2f70641
@gramos gramos - ActiveResource, only constantize the resource class
  when is used it.
0f8669e
@gramos gramos - ActiveResource assocition belongs_to dont save the obj. db7b02c
@gramos gramos - ActiveResource added
  test_has_many_accessor_should_return_the_an_array_with_the_associated_milestones
0328ff7
@gramos gramos - ActiveResource
  test_has_many_accessor_should_return_the_an_empty_array_when_it_does_not_has_milestones
532503c
@gramos gramos - Active Resource associations, refactoring remove some duplication 4c339de
@gramos gramos - ActiveResource associaions
  test_has_many_accessor_should_return_the_an_array_including_the_added_obj
38800d7
@gramos gramos Active Resource has_many association, change eval by instance_eval 8c8a2ab
@gramos gramos - Active Resource associations, dont need send with eval 5957c26
@gramos gramos - ActiveResoruce association added method delete to has_many
  association
3762032
@gramos gramos - ActiveResource added clear method to has_many association 3e32d63
@gramos gramos - Active Resource Fix has_many association, update resource list
  after some methods
4f16129
@gramos gramos - ActiveResource association has_many, added method resource= 03f51e1
@gramos gramos - ActiveResource association has_many fix resource=
  should set an array with the added methods
fa49cd8
@gramos gramos - added ActiveResoruce::Associations::AssociationCollection
  move all related methods to this new class
8027093
@gramos gramos - ActiveResource::Associosiations::AssociationCollection, added missi…
…ng file
43d5866
@gramos gramos - some changes about coding style 8a0fe20
@gramos gramos - ActiveResource::Associations, simple cache added (like AR)
  project.milestones             # fetches milestones
  project.milestones.size        # uses the milestone cache
  project.milestones(true).size  # fetches milestones
fc4e765
@gramos gramos - added documentation for ActiveResource::Associations be8cbf6
@gramos gramos - added cache doc ActiveResource::Associations 249c4ed
@gramos gramos - ActiveResource::Associations, update doc. 1ed964a
@gramos gramos - ActiveResource::Associations, fix some typo error in doc
- tiny fix in set_resource_instance_variable
9f634ec
@gramos gramos - ActiveResource::Associations, added doc for has_one 9ee1e16
@gramos gramos - ActiveResource::Associations, Fix doc 9d8b876
@gramos gramos Merge branch 'ares-associations' of github.com:gramos/rails into ares…
…-associations
eb5e3c3
@hosiawak
hosiawak commented Oct 6, 2010

+1

@gramos
gramos commented Oct 6, 2010

This pull request is wrong I did a mistake with the git rebase, I did a new fresh pull request:
http://github.com/rails/rails/pull/70

@claudiob claudiob pushed a commit to claudiob/rails that referenced this pull request Sep 23, 2014
@robin850 robin850 Follow up of #68
Try to be consistent across the different stylesheets and fix the CSS
for the rails theme.
a1d7e21
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.