I am using Rails 3 with Mongoid. I have two documents: class MyUser include Mongoid::Document field ......
I am relatively new to Rails and am working on a project that involves multiple, \"nested\" levels of data. I am having issues making the proper associations so I can get all the child elements of a m
So, I\'ve read in some book about tip \"Use model association\", which encourages developers to use build methods instead of putting ids via setters.
I have a question regarding instantiating a model with a belongs_to association. Taken from the start of http://guides.rubyonrails.org/association_basics.html :
I have a has many through relationship with my groups and guests models. Here are the models: class Group < ActiveRecord::Base
I\'m working with a data concept that Rails doesn\'t seem to do great with - a Route has two (and only two) Airports. I finally figured out how to hard-code my foreign keys so that they would be sensi
class CreateMatches < ActiveRecord::Migration def self.up create_table :matches do |t| t.integer :result_home
I am using ruby on rails 3.1 and have 2 models, an event and a group. Each event has_many groups, but has to have at least one \"master\" group, where the column :is_master => true
I\'m reading Apress Pro ASP.NET MVC Framework and there are some LINQ to SQL examples, but they don\'t show the database for this example and it\'s not entirely clear how it works so I was hoping I ca
What I would like to do is when a user is created, it automatically gives them a role. The thing is that the role is related to the user via an assignment table and a has_many through association.