Closed ylluminate closed 9 years ago
I'm in the process of finishing integrating Codeship to ensure our tests are always green (https://github.com/Hobo/hobo/tree/codeship_testing). Once that's done, I think it shouldn't be too hard to get Rails 4.2 up and running. But I haven't played with it yet.
If you want to play around with it and see what happens, that would be fantastic!
Rails 4.2 has the same issue as https://github.com/Hobo/hobo/issues/97 from what I can tell. Seems like some Gemfiles just need to be updated unless there is actually a break.
I thought, I give my app a try with 4.2. Updating the gems is quite straight forward, there were some hard coded dependencies in Hobo to loosen and then I got the bundle to be installed.
Starting the app itself fails with
rails/hobo/hobo/lib/hobo/model/permissions.rb:114:in `belongs_to_with_hobo_permission_check': undefined method `options' for nil:NilClass (NoMethodError)
I saw this coming up from paper_trail gem which declares a has_many :versions
relation implicitly. But commenting out then also brought the same error with
home/stefan/daten/rails/hobo/hobo/lib/hobo/model/permissions.rb:114:in `belongs_to_with_hobo_permission_check': undefined method `options' for nil:NilClass (NoMethodError)
from /home/stefan/daten/rails/hobo/hobo/lib/hobo/model/accessible_associations.rb:142:in `belongs_to_with_accessible'
from /home/stefan/daten/rails/hobo/hobo/lib/hobo/model.rb:137:in `belongs_to_with_creator_metadata'
from /home/stefan/daten/rails/hobo/hobo/lib/hobo/model.rb:141:in `belongs_to_with_test_methods'
from /home/stefan/daten/rails/hobo/hobo_fields/lib/hobo_fields/model.rb:92:in `belongs_to_with_field_declarations'
from /home/stefan/daten/rails/mercator/app/models/conversation.rb:17:in `<class:Conversation>'
where line 17 in the conversation model is just
belongs_to :customer, class_name: 'User', inverse_of: :conversations
So I'm afraid that all relations seem to be broken....
Then I tried (without knowing details - we are just in permissions and who cares about them? ;-) ) to just get rid of the error by exchanging the failing line
if reflection.options[:dependent]==:destroy
for
if reflection && reflection.options[:dependent]==:destroy
Using the some strategy in a second place I finally failed with
/home/stefan/daten/rails/hobo/hobo/lib/hobo/model.rb:143:in `belongs_to_with_test_methods': undefined method `options' for nil:NilClass (NoMethodError)
from /home/stefan/daten/rails/hobo/hobo_fields/lib/hobo_fields/model.rb:92:in `belongs_to_with_field_declarations'
from /home/stefan/daten/rails/mercator/app/models/conversation.rb:17:in `<class:Conversation>'
coming form the some belongs_to relation.
Then I was just on the "well let's get crazy route" and ditched the belongs_to relations in this model. Then I got the same error from another belongs_to relation in another model.
Enough tried and going back to 4.0 for today ... but I think it's a good thing that the error is finally in a hobo file and not somewhere crazy deep in the rails stack. Sorry not being able to help here, but at least I promise to continue testing stuff, when Ignacio sees some light here.
Thanks a lot Stefan! That seems like the kind of error we should be able to fix.
I'll dive into it ASAP :)
Solved, Rails 4.2 support is here!
Haven't experimented with hobo on rails 4.2 yet, but was curious if anyone has had any success or hiccups therewith?