nested not working on :has_one association

32 views
Skip to first unread message

Hernan Astudillo

unread,
May 26, 2012, 1:14:37 AM5/26/12
to activescaffold
has_many is ok, but has_one raises:

NoMethodError (undefined method `model' for #<Class:0x00000005be6e28>):
  activerecord (3.2.3) lib/active_record/dynamic_matchers.rb:50:in `method_missing'
bundler/gems/active_scaffold-015834566f3e/lib/active_scaffold/actions/nested.rb:80:in `beginning_of_chain'
bundler/gems/active_scaffold-015834566f3e/lib/active_scaffold/finder.rb:301:in `find_page'
bundler/gems/active_scaffold-015834566f3e/lib/active_scaffold/actions/list.rb:78:in `do_list'
bundler/gems/active_scaffold-015834566f3e/lib/active_scaffold/actions/list.rb:20:in `list'
bundler/gems/active_scaffold-015834566f3e/lib/active_scaffold/actions/list.rb:9:in `index'


and as i can see the problem is in lib/active_scaffold/actions/nested.rb where it says:

super.model.where(nested.child_association.foreign_key => nested.parent_scope)

and before it was:

active_scaffold_config.model.where(nested.child_association.foreign_key => nested.parent_scope)

ruby doesn't like super models :D

i tested and with active_scaffold_config works fine. However i don't know the inheritance here.


ser...@entrecables.com

unread,
May 26, 2012, 3:47:22 AM5/26/12
to actives...@googlegroups.com
Change was broken, super should replace active_scaffold_config.model

On Sat, 26 May 2012 01:14:37 -0400, Hernan Astudillo <naa...@gmail.com>
wrote:
> has_many is ok, but has_one raises:
>
> NoMethodError (undefined method `model' for #):
> --
> You received this message because you are subscribed to the Google
> Groups "ActiveScaffold : Ruby on Rails plugin" group.
> To post to this group, send email to actives...@googlegroups.com.
> To unsubscribe from this group, send email to
> activescaffol...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/activescaffold?hl=en.

Reply all
Reply to author
Forward
0 new messages