Disable lazy loading?


I have 2 active records with has_one/belongs_to association between

class Story < ActiveRecord::Base
belongs_to :conclusion

class Conclusion < ActiveRecord::Base
has_one :story

Sometimes I fetch a conclusion with story in eager loading, sometimes
I don’t fetch the associated story.

I want to know when the associated story is fetched or not
conclusion.story.loaded? doesn’t work.

Another question : how to completely disable lazy loading ? In order
to be able ton simply do : conclusion.story == nil.

Thanks for your answers.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs