last day (15 days later) » 

3:55 PM
0
Q: Override model association conditional for particular functionality

adrianmannI have a User model that will return user studies that have a status of true: has_many :user_studies, -> { where(status: true) }, dependent: :destroy I am using this for over 80% of my functionality but there are some instances where I want to override this line of code. I have a private meth...

 
before_action :set_user_study,... inside a controller right...?
 
@ArupRakshit Sorry, yes, I will edit.
 
show the edit action inside the controller..
 
You don't need it @ArupRakshit, anyways its empty its just to render the edit page. Its literally, def edit end.
 
Ok.. Then from where you are setting this @user ?
 
3:55 PM
@ArupRakshit In another private method which I just added.
Hey man, any ideas?
 
Sure
can I have 20 minutes ?
I am taking my dinner
 
I will still be here, thanks.
 
well.. I'll be back very soon
If you get the answer by that time.. let me know also..
 
4:31 PM
@adrianmann is it resolved ?
 
No man, I am trying to play around with Customizing the query: api.rubyonrails.org/classes/ActiveRecord/Associations/…
 
ok... let me knoe if you need help
 
cool
 

  last day (15 days later) »