Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9243681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:51:35+00:00 2026-06-18T08:51:35+00:00

I have my models setup as a many-to-many using through with a pivot table.

  • 0

I have my models setup as a many-to-many using through with a pivot table. However, I would like to add some extra data into the pivot table.

In the past (kohana 3.0) I was able to provide extra data with the add method

$obj->add('alias', $related, array('extra'=>'data'))

But its seems in Kohana 3.3 that the add method does not provide the third parameter for extra data, and I cannot seem to find how to do this short of after saving, adding more data then re-saving.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:51:37+00:00Added an answer on June 18, 2026 at 8:51 am

    This isn’t supported anymore since Kohana 3.1.

    The reason they removed it (Source: http://dev.kohanaframework.org/issues/3754):

    We decided to remove this because it’s better to use a through model
    if you need to put data in your pivot table. Inserting the data
    directly in the add() method bypasses validation and filtering that
    would normally be in your model. Use a model if you need data in your
    through table. We won’t be changing this.

    You now have to make a model for the pivot table and place the additional information in that model.

    Then instead of using has_many "through" (n:n) you should use has_many (1:n) relationship for both tables to the pivot table.

    I hope this answers your question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some issues using has_one, through => model . The best is to
I have my models setup like so: class User < ActiveRecord::Base has_many :posts, :foreign_key
I have a typical many-to-many relationship using has_many => :through , as detailed below.
I would like to enable CASCADE DELETE on a table using code-first. When the
I have following models setup in my Django application class School(models.Model): name = models.TextField()
i have the following models setup class Player(models.Model): #slug = models.slugField(max_length=200) Player_Name = models.CharField(max_length=100)
I have three models that I'm trying to setup: Location/Venues, Categories, and Neighborhoods. A
I have a basic invoice setup with models: Invoice, Item, LineItems. # invoice.rb class
I have this setup in my models: class Author(models.Model): name = models.CharField(max_length=100) class Topic(models.Model):
I have a two models set up like this: class User < ActiveRecord::Base #

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.