Couple tips:
- don't capitalize association names. It might not affect anything at
first, but
it will eventually bite you when the inflector gets confused.

- as noted by others, don't optimize early. And even if you're trying
to optimize
early, why would 'delete profile' be a bottleneck? Surely views are
going to be
much, much more common...

- finally, while what you're asking about was possible in older
versions of Rails
(but seriously deprecated since about 2.0), I believe that the support
has been
removed from 2.3. The best practice now is to use a join model with
has_many :through.
Message me if you're not sure how to set that up.

--Matt Jones

On Feb 19, 2:17 am, Preethi Sivakumar <rails-mailing-l...@andreas-
s.net> wrote:
> Hi,
>
> I'm having a HABTM relationship between profiles and users where User
> and Profile are having a many to many relationship.
> --------------------------------------------------------------------------
> User Model:
> has_and_belongs_to_many :Profiles
>
> Profile Model:
> has_and_belongs_to_many :Users
> --------------------------------------------------------------------------
>
> My mapping table has profile_id and user_id as two columns
>
> My requirement is, I want to add an additional column in the mapping
> table without creating a model for that table.
>
> The additional column i need is "rowstate" which I'll be using to
> softdelete the rows in the mapping table when user is unassigned from a
> profile.
>
> How could i achieve that?(without creating a new model for the mapping
> table)
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to