Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8603323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:17:48+00:00 2026-06-12T02:17:48+00:00

I have a model Comment, which hasOne model UserDigest. For some reason, I want

  • 0

I have a model Comment, which “hasOne” model UserDigest.
For some reason, I want to load the UserDigest else where and then put it into the correspond Comment. Do something like this:

comment.userDigest().setData(userDigest.getData());

But I cannot find a method like that. Can someone tell me how to set an existing record as the data of associated model ?

Or how to assign an existing model to associated model? Something like this:

comment.userDigest = userDigest; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:17:50+00:00Added an answer on June 12, 2026 at 2:17 am

    there should be a comment.setUserDigest() method auto-created for comment, when you setup the relationship.

    if you use namespaces for your models then you will have to set the setterName property in the relationship, where you can set it as setUserDigest

    this only sets the foreign value though, and you will probably want to set the instance as well. you may have to change the name and instanceName of the relationship too.

    please read this:

    http://extjs-tutorials.blogspot.ca/2012/05/extjs-belongsto-association-rules.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a YML file containing fixtures for a Rails model (Comment) which looks
I have a model Comment, which has_a User. In my display page, I am
I have a Post model and a Comment model (which is a nested resource
I'll just jump right into it. I have a model called Request which I
Suppose I have an Comment model that belongs_to a Post model. I want to
I have a Comment model in my app but am encountering a lot of
I have a content model and a comment model. On insertion of comment I
In my app I have a article and comment model. I implemented a reply-feature,
I have a data model where a User can like a Project, Suggestion, Comment
I have Comment as a polymorphic model. It is attached to Post, Review, etc.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.