Many gems do not work properly with jRuby.  You might check with jRuby Website
and the acts_as_audited Website.  I don't have a jRuby installation handy.

My only suggestion is back way off on the functionality until it behaves as
expected and then add functionality back in with lots of puts statements
and/or logger statements.  Array#sum() is a Rails extension.  You might try
using inject.

E.g. observed_classes.inject([]){|a, i| a + i.send(:subclasses)}

It is implied, but not stated.  Does your rewrite of observed_subclasses()
work as expected?

Sorry couldn't be more help,
  Jeffrey


Quoting femto <femto...@gmail.com>:
> observed_classes is [].
> I replied earlier, but the google post forum seems to
> went some wrong, so makes my post unsuccesful.
> Sorry for that.
> 
> On 11月26日, 下午4时50分, "Jeffrey L. Taylor" <r...@abluz.dyndns.org> wrote:
> > Quoting femto <femto...@gmail.com>:
> >
> >
> >
> >
> >
> > > Hello all, while I'm using acts_as_audited(on jruby platform),
> > > after vendored the acts_as_audited, it reports some error,
> > > line 167,
> > > # Start observing the declared classes and their subclasses.
> > >    def initialize
> >
> > >      Set.new(observed_classes + observed_subclasses).each { |klass|
> > > add_observer! klass } #this line
> > >    end
> > > after some trace shows this one, when observed_classes is empty, will
> > > return 0(Fixnum) causes the
> > > above line to report error,
> >
> > > def observed_subclasses
> > >        observed_classes.sum([]) { |klass| klass.send(:subclasses) }
> > > end
> >
> > > so I changed it to this:
> >
> > > def observed_subclasses
> > >        #observed_classes.sum([]) { |klass| klass.send(:subclasses) }
> > >        result = []
> > >        observed_classes.each do |klass|
> > >           result += klass.send(:subclasses)
> > >        end
> >
> > >      end
> > > It this a bug?
> >
> > What is definition of observed_classes?  When there are no observed classes,
> > does it return [] or nil?
> >
> > Jeffrey
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 
> 

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to