Here\'s my User model: class User < ActiveRecord::Base has_many :friends, :class_name => \'Friendship\', :dependent => :destroy
Here\'s my User model: class User < ActiveRecord::Base has_many :friends, :class_name => \'Friendship\', :dependent => :destroy
I\'m trying to create an object and adding an existing object to a \"has_many through\" association, but after saving my object the reference to my newly created object is set to nil in the join model
I know this topic has been approached several times before in various ways, but I haven\'t been able to synthesize the other questions to meet this particular use case for Rails 3:
I have been stuck on this for a day now.I\'ve heard all of this talk of Rails being able to handle easy complexities like this (although this isn\'t/shouldn\'t 开发者_开发技巧be complex).
I\'m currently working on a small social networking application and right now I\'m trying to create a model that represents friendships between users. This is what I came up with so far:
I\'ve got a many-to-many relationship between ledger and staff and would like to use Thinking-Sphinx (TS) to search ledgers which the current_staff member owns.
create_table \"friendships\", :force => true do |t| t.integer\"user_id\" t.integer\"friend_id\" t.datetime \"created_at\"
i moved from php to rails3, and i still think it was a good decision! Anyway I have some models: users
I\'ve got a model setup like the following: class User has_many :items has_many :words, :through => :items