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 8911961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:04:54+00:00 2026-06-15T04:04:54+00:00

I am very new to Ruby on Rails and I’m trying to access the

  • 0

I am very new to Ruby on Rails and I’m trying to access the scores from a specific Organization. I was wondering if someone could point me in the right direct of being able to accomplish this. I currently have the following Models:

Here is the User Model

class User < ActiveRecord::Base
 attr_accessible :fname, :lname, :email, :password, :password_confirmation
 has_secure_password
 belongs_to :organization

Here is the Organization Model

class Organization < ActiveRecord::Base
 attr_accessible :name, :employee_number, :country, :postal_code, :sic_code, :primary_url
 has_many :users
 has_many :social_entities
 has_many :social_scores, :through => :social_entity  
 has_many :social_channels, :through => :social_entity

Here is the Entity Model

class SocialEntity < ActiveRecord::Base
 attr_accessible :name, :org_id
 has_many :social_channels
 has_many :social_scores  
 belongs_to :organization

Here is the Channel Model

class SocialChannel < ActiveRecord::Base
 attr_accessible :authorized, :channel_identifier, :channel_type, :name, :social_entity_id
 belongs_to :social_entity  # edited from original post, :socialentity

Here is the Score Model

class SocialScore < ActiveRecord::Base
 attr_accessible :engagement_score, :popularity_score, :presence_score, :reputation_score,   :score_period_end, :score_period_start, :score_period_type, :score_timestamp, :social_entity
 belongs_to :social_entity

Here is a description of what I am trying to do. A User logs into the system, the user is tied to a organization, each organization has a social entity which has social channels and scores. I want to be able to display the scores for the organization in the view.

  • 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-15T04:04:55+00:00Added an answer on June 15, 2026 at 4:04 am

    If you have an instance of Organization, the has_many declaration creates an attribute (a method, really) that gets a collection of SocialScores, referenced by social_scores, e.g.

    @org = Organization.find(:first)  # or however else it is that you get the organization instance
    @org.social_scores.each do |ss|
       puts "Popularity score for id #{ss.id} is #{ss.popularity_score}"
    end
    

    Is that what you were seeking?

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

Sidebar

Related Questions

Hey, I'm very new to Ruby and Rails. I was wondering if I was
I'm very new to Ruby on Rails and learning while trying to fix some
Very new to ruby on rails and trying to get my first ajax call
I'm very new to Ruby on Rails so please go easy! I've uploaded the
I have built a very simple blog application using Ruby on Rails. New to
I am very new to Ruby, and was wondering how I can update the
I am very new to Ruby so could you please suggest the best practice
I'm very new to ruby. I'm trying to search for any instance of a
I am very new to ruby on rails. I've installed a complicated ruby on
i am very new to Ruby on rails . while running script/console , i

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.