Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

readonly option

#5258

The readonly feature bites me a lot. It seems that in the common case of a simple join, the models are marked as "readonly?" when in fact they are perfectly suitable for writing. Yes, I know how to force the object to be readable, but in this common case it seems pointless to force me to do that.

Why is this?

>> User.last(:joins => :profile, :conditions => {:profiles => {:gender => "male"}}).readonly?
  User Load (0.5ms)   SELECT `users`.* FROM `users` INNER JOIN `profiles` ON profiles.user_id = users.id WHERE (`profiles`.`gender` = 'male') ORDER BY users.id DESC LIMIT 1
=> true

That select statement seems to return a full, saveable user object. Why is it readonly?

Reported by Greg Hazel · July 30th, 2010 @ 10:28 PM

State: open
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Ryan Bigg
    Ryan Bigg
    • Importance changed from to Low

    If you would like this fixed please submit a patch.

    October 11th, 2010 @ 02:20 AM

  2. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 11th, 2010 @ 02:56 AM

  3. Ryan Bigg
    Ryan Bigg

    Automatic cleanup of spam.

    October 19th, 2010 @ 08:24 AM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:48 PM

  5. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:48 PM

  6. Greg Hazel
    Greg Hazel
    • State changed from stale to open

    [state:open]

    February 2nd, 2011 @ 07:24 PM

  7. rails
    rails

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    May 3rd, 2011 @ 01:00 AM

  8. rails
    rails
    • State changed from open to stale

    May 3rd, 2011 @ 01:00 AM

  9. Greg Hazel
    Greg Hazel
    • State changed from stale to open

    Oh no, not this again.
    [state:open]

    May 3rd, 2011 @ 01:08 AM

  10. Brian Racer
    Brian Racer

    This is the intended and documented functionality of :join. If you know you will be modifying the associated model you should use :include instead. I don't think non-readonly functionality logic should be added to :join since there is overhead in instantiating each of the associated models.

    May 7th, 2011 @ 10:38 PM

  11. Greg Hazel
    Greg Hazel

    I'm not talking about the associated models, I'm talking about the primary models.

    May 8th, 2011 @ 01:48 AM