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

Does not redis_orm support HABTM? #5

Open
satoryu opened this issue May 10, 2013 · 1 comment
Open

Does not redis_orm support HABTM? #5

satoryu opened this issue May 10, 2013 · 1 comment

Comments

@satoryu
Copy link
Contributor

satoryu commented May 10, 2013

I created 2 models

class User < RedisOrm::Base
  property :name, String

  has_many :books
end

class Book < RedisOrm::Base
  property :title, String

  has_many :users, as: :authors
end

And

user = User.create(name: 'Kent Beck')
user.books << Book.create(title: 'Refactoring')

But this code fails as follows:

       undefined method `pluralize' for :authors:Symbol

How should I do in this case?
has_many looks like not support HABTM
https://github.com/german/redis_orm/blob/master/lib/redis_orm/associations/has_many.rb#L7

@german
Copy link
Owner

german commented May 20, 2013

@satoryu sorry, just saw this issue. it could be easily fixed in an hour

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

No branches or pull requests

2 participants