Here's a testament to Cake. I have a rails app, which was molded
arounded a legacy DB, and I have to migrate it to Cake.
Problem is, I don't know how to specify certain relationships between
the DB in Cake -- I'm not even sure they CAN be modeled by Cake.
Can someone please show me if and how the following relationships can
be modelled by Cake? Thanks, R.Vince
set_table_name 'selectionslist'
set_primary_key 't_id'
has_and_belongs_to_many :leads, :join_table =>
'selectionschosen', :foreign_key =>
'selections_key', :association_foreign_key => 'leads_key
as well as:
class Activity < ActiveRecord::Base
belongs_to :activitytype, :foreign_key => 'type'
has_many :chronology, :foreign_key => 'activities_key'
has_many :statusactivities, :foreign_key => 'activity'
#add the following because I get the error:
#This error is raised because the column 'type' is reserved for
storing the class in case of inheritance. Please rename this column if
you didn't intend it to be used for storing the inheritance class or
overwrite Activitytype.inheritance_column to use another column for
that information.
def self.inheritance_column
"rails_type"
end
def scaffold_name
self.activity.to_s
end'
def self.scaffold_fields
["activity","attachment","type","available_to_all","hasspecifictime","timetoperform","duration","weekends"]
end
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---