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

Rails 3.2.13 problems with has_many_through relationships #12

Open
tilo opened this issue Nov 23, 2013 · 2 comments
Open

Rails 3.2.13 problems with has_many_through relationships #12

tilo opened this issue Nov 23, 2013 · 2 comments

Comments

@tilo
Copy link

tilo commented Nov 23, 2013

In Rails 3.2.13 I'm experiencing problems when trying to use tableless models as
one side of a has_many_through relationship

  class List < ActiveRecord::Base
     # persisted model
     has_many :memberships
     has_many :items , :through => :memberships
   ...
  end

  class Item < ActiveRecord::Base
    has_no_table :database => :pretend_success

    has_many :memberships
    has_many :lists , :through => :memberships

    ...
  end

  class Mermbership < ActiveRecord::Base
    # persisted model / join model
    belongs_to :list
    belongs_to :item
  end

  l = List.first
  l.items
  (Object doesn't support #inspect)

 l.items.class
 NoMethodError: undefined method 'supports_explain?' for #<Object:...>
@tilo
Copy link
Author

tilo commented Nov 25, 2013

the faked connection needs to fake the select_all, select_value, select_values calls

@jarl-dk
Copy link
Member

jarl-dk commented Nov 25, 2013

Thanks for investigating, can you provide a pull request...

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