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 7843373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:32:02+00:00 2026-06-02T16:32:02+00:00

This is very similar to Rails partial updates problem with hashes , but the

  • 0

This is very similar to Rails partial updates problem with hashes , but the question has not really been answered IMHO.

The problem is this: I have a model with a serialized column:

class Import < AR::Base
  serialize :data

In my case, this data will, and should, not change after the first save/creation of the model. So I want to disable the feature of AR that always saves serialized columns (which is normally a good idea, as it can’t detect those changes). I want to disable the saving because the data can be quite large, and the model will be updated frequently.

I’ve already tried monkeypatching into ActiceRecord::AttributeMethods::Dirty like this:

class Import
  def update(*)
    if partial_updates?
      super(changed | (attributes.keys & (self.class.serialized_attributes.keys - ["data"])))
    else
     super
   end
 end

but this seems to have no effect. Anybody got a better idea ?

This is under Rails 3.0.12

  • 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-02T16:32:06+00:00Added an answer on June 2, 2026 at 4:32 pm

    What I ended up doing, even though it’s not really an answer to the original question, is the following:

    class Import < AR::Base
      belongs_to :storage
    
    class Storage < AR::Base
      serialize :data
    

    …i.e. moving the data column into a model of its own, and associate that with the original model. Which is actually conceptually somewhat cleaner.

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

Sidebar

Related Questions

My question popped up a very similar question, this one . But the accepted
I know there is this question that is very similar, but I wanted to
My question is very similar to this one : Changing Current Tab in Rails
This is very similar to another recent question: How can I return the current
This is very similar to a previous question (and may be the exact same
I know this is very similar to a few other questions, but I can't
This is a very similar question to this SO thread on middleware and views
This post is very similar to my previous one, but the data structures are
This question is very similar to an earlier question I asked ( This Question
I know that this question is very similar to the question posted here .

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.