Consider the following models: class Artist < ActiveRecord::Base has_many :artist_events has_many :events, :through => :artist_events
A Post belongs_to a User, and a User has_many Posts. A Post also belongs_to a Topic, and a Topic has_many Posts.
Rails 2.1.0 (Cannot upgrade for now due to several constraints) I am trying to achieve this. Any hints?
This is my code: class Friend < ActiveRecord::Base belongs_to :user belongs_to :friend, :class_name => \"User\", :foreign_key => \"friend_id\"
I have a class Bar that has a user-defined list of config keys and values, defined like this: class Bar < ActiveRecord::Base
Is it possible to have multiple has_many :through relationships that pass through each other in Rails?I received the suggestion to do so as a solution for another question I posted, but have been unab
I\'m not sure if this is feasible or even preferable But I\'d like to build a has_many relationship or a conditional named_scope type relationship to ease my pain into one simple relationship instead
I am thinking about ways to create a Role Based Access Control system in Rails.I have seen these great projects too (among others):
I\'ve got users who are members of groups through a membership join table, and one of the attributes of that join table is \"administrator\". I\'m trying to do a check inside of a group\'s member view
I have trouble with the self referential association, the models should give ma an array of models for the left_chunks and right_chunks methods, but I get everytime an empty array