Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
config
db/migrate
lib
spec/dummy/rails_app
.gitignore
CHANGELOG.markdown
Gemfile
MIT-LICENSE
README.md
Rakefile
associator.gemspec

README.md

Associator

Associate any model to any model.

Description

Creates a one-to-many relationship between any models.

#Installation 1 Add to your application Gemfile

  gem 'associator'

2 Type

  bundle install
  rake associator_engine:install:migrations
  rake db:migrate

#Usage ##In your rails app model ###Add to your model

  associated :with => :THE_OTHER_MODEL_NAME

or

  associated :with => :RELATION_NAME, :class_name => 'THE_OTHER_MODEL_CLASS_NAME'

###Add relation

  foo = Foo.first
  bar = Bar.first
  foo.add_associated bar

###Remove relation

  foo = Foo.first
  bar = Bar.first
  foo.del_associated bar

License

Released under the MIT license: http://www.opensource.org/licenses/MIT

You can’t perform that action at this time.