Guest User

Untitled

a guest
Feb 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Function that loads Questions/Comments
  2.  
  3. public function loadQuestions():void {
  4. Ruboss.models.reload(Question, {metadata: {creatorID: N360.models.currentUser.id, building_id: N360.models.currentBuilding.id} });
  5. mainViewStack.selectedChild=questions;
  6. }
  7.  
  8. Rails Controller:
  9.  
  10. @questions = Question.all( :conditions => { :building_id.eql => params[:building_id], :creator_id.eql => params[:creatorID] }, :order => "created_at DESC" )
  11.  
  12. format.fxml { render :fxml => @questions.to_fxml(:methods => [:question_asker], :include => {:comments => {:methods => [:comment_creator]}}) }
  13.  
  14. private function onQuestionSelect():void {
  15. _question = RubossUtils.clone(questionsList.selectedItem) as Question;
  16. ... other stuff non-relevant
  17. }
  18.  
  19. Upon first load _question.comments.length will give the right total. However once I click on the button again, length goes to 0, even though the log output shows the correct xml being pulled.
  20.  
  21. Bug or am I doing something wrong?
Add Comment
Please, Sign In to add comment