As far as I can tell, the underlying issue with STI has not been fixed
in 3.2 (building an sti model from an association still fails). The
pull request referenced in active_scaffold code was closed and never
committed to rails.
I think the patch still works, but setting
self.original_build_association_called fails and is no longer
necessary because it was just some internal rails mechanism.
Rails 3.1 code has:
# This is a hack so that we can tell if build_association was
overridden, in order to
# provide an appropriate deprecation if the overridden method
ignored the &block. Please
# see Association#build_record for details.
attr_accessor :original_build_association_called # :nodoc
I'm going to remove setting "original_build_association_called" from
my fork, but I don't think removing the entire patch is a good idea,
which some other active_scaffold forks have started to do.
Can anyone comment otherwise?
On Jan 28, 9:11 pm, Nick Rogers <
ncrog...@gmail.com> wrote:
> Also getting this error in some of my scaffolds when clicking Create.
>
> Deleting lib/active_scaffold/extensions/active_association_reflection.rb
> fixes the problem, but I am unsure if this leaves something else with STI
> broken.
>
>
>
>
>
>
>
> On Sat, Jan 28, 2012 at 5:56 PM, Nick Rogers <
ncrog...@gmail.com> wrote:
> > In 3.2, I'm getting the following when clicking on certain nested scaffolds
>
> > undefined method `original_build_association_called=' for
> > #<ActiveRecord::Reflection::AssociationReflection:0x10d3c2428>
>
> > active_scaffold has active_association_reflection.rb to fix some bug in
> > rails.
> > # Bugfix: building an sti model from an association fails
> > #
> >
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6...
> > #
https://github.com/rails/rails/issues/815
> > #
https://github.com/rails/rails/pull/1686