Thanks Jeremy for your answer. I added logs to see if wrong loading order 
could make it crash like this, but this not an easy issue to fix.

Thanks again

Le vendredi 17 février 2017 18:23:51 UTC+1, Jeremy Evans a écrit :
>
> On Friday, February 17, 2017 at 7:58:18 AM UTC-8, Benoit wrote:
>>
>> Hello
>>
>> I have a very small sequel model like this : 
>>
>> # lib/aws_stats/unique_shop_application_downloads.rb
>> Sequel::Model.db = StatsDb.connection
>>
>> class AwsStats::UniqueShopApplicationDownloads < Sequel::Model(:
>> unique_shop_application_downloads)
>>   def self.by_shop_application_id(shop_application_id)
>>     where(shop_application_id: mobile_application_id).get(:user_count)
>>   end
>> end
>>
>> It is call by a AR model
>>
>> class ShopApplication < ActiveRecord::Base
>>
>>   class StatsProxy
>>     attr_reader :sa, :unique_downloads
>>
>>     def self.proxify_with_stats(shop_applications)
>>       # ...
>>       downloads = AwsStats::UniqueShopApplicationDownloads
>>                   .where(shop_application_id: mas.map(&:id))
>>                   .to_hash(:shop_application_id, :user_count)
>>       # ...
>>     end
>>   end
>> end
>>
>> But sometimes after booting I get :
>>
>> Circular dependency detected while autoloading constant AwsStats::
>> UniqueShopApplicationDownloads
>>
>> I read many blog post and doc :
>> http://neethack.com/2015/04/rails-circular-de
>> http://guides.rubyonrails.org/autoloading_and_reloading_constants.html
>>
>> https://robots.thoughtbot.com/how-to-fix-circular-dependency-errors-in-rails-integration-tests
>>
>> but still don't understand why I have this issue.
>>
>> I'm also unable to reproduce the bug locally. Can Sequel be related to 
>> this issue (I don't think so but I'm stuck)? 
>>
>
> This doesn't appear to be a Sequel issue.  I'm not sure if there is a way 
> to increase the logging and get more information (such as which dependency 
> it thinks is circular), but if not, I don't have any other suggestions.
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to