Displaying 5 results from an estimated 5 matches for "dawillis".
Did you mean:
cgwillis
2006 Jun 13
9
act_as_versioned and join tables?
Greetings!
I''m attempting to use the act_as_versioned plugin to provide versioning
functionality for my rails app, but can''t think my way through this:
How can you use act_as_versioned to perform versioning on a HABTM join
table? It is easy to see how to do so for join models (:has_many
:through) but not so for the join table.
I want to use act_as_versioned to maintain
2006 Apr 05
0
Has Many :through associations
Greetings again:
I''m simplifying the case I presented earlier regarding the use of
has_many :through. I''m using DHH''s example from "Persuing Beauty with
Ruby On Rails".
Here are his models:
class Author < ActiveRecord::Base
has_many :authorships
has_many :books, :through => :authorships
end
class Book < ActiveRecord::Base
has_many
2006 Apr 05
4
Self-referential join creation/deletion and :through
Greetings.
First, this example is just my way of exploring :through. It probably
doesn''t need has_many :through, and could just use a standard HABTM
association.
Here''s the models:
class CourseRequisite < ActiveRecord::Base
belongs_to :requisite, :class_name => ''Course'', :foreign_key =>
''requisite_id''
belongs_to :course,
2006 Apr 11
3
Validations and has_many :through (Join Models)
Hello again:
I''m hoping that somebody, anybody, can help with this question.
How do I make sure that records in a join model are unique?
Using the scenario outlined in Chad Fowler''s "Rails Recipies", number
16, "Many to Many Relationships Where the Relationship Iteself Has
Data".
Here are the tables:
create_table :magazines do |t|
t.column :title,
2006 Apr 20
5
Using Migrations to convert join table to join model
Greetings,
I''m trying to convert a HABTM w/attributes join table in my database
into a join model table in order to utilize the new has_many :through
functionality introduced in Rails 1.1. Here''s the current table
definition:
licenses_user_groups: license_id, user_group_id, usage_notes
Perhaps it was a mistake, but I made (license_id, user_group_id) the
primary key.
Now,