Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added dependants and through for relationships #2

Open
wants to merge 90 commits into
base: master
Choose a base branch
from

Conversation

sugandhaa
Copy link

No description provided.

added dependent - destroy for collection creator relationship and collection location entry
added Through accession location entries
Added through accessions
added through collection creation relationships
added through creator book relation ships
added through digital contents
changed has_one to has_many
dependant added
through and dependants added
@paulnsorensen
Copy link
Member

I just realized that a lot of the relationships are camelCased, and they should be underscore_cased. Please update before I pull this in.

@sugandhaa
Copy link
Author

Paul..Do we have to change the class names too ? cos, I guess while declaring a variable it should follow the similar conventions except that it is pluralized or un pluralized ?how will rails detect otherwise which class is in the relation ship?Correct me if iam wrong

@paulnsorensen
Copy link
Member

The class names are always camel cased, but everything within the class is not. You should follow the pluralized conventions, rails will be able to detect it. For instance, you could have a class like this

class Car < ActiveRecord::Base
  has_many :model_types
  belongs_to :auto_manufacturer
end

class ModelType < ActiveRecord::Base
  belongs_to :car
end

class AutoManufacturer < ActiveRecord::Base
  has_many :cars
end

sugandhaa and others added 30 commits November 21, 2012 13:43
has many collections, creators, user_repository_relationships, users
belongs to repository
added belongs to relationships
belongs to creator relationship type
has language and subjects relationships, 
has files
digital_content_subject_relationships
has many collection content relationships, belongs to subject_type
added has many creators
added has_many creators
added has many relationships
added has many user fields
added has many creators, digital contents, digital content creator relationships
added belongs to country
added has many colections
added attr_accessible fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants