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

  • Home
  • SEARCH
  • 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 884191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:42:52+00:00 2026-05-15T12:42:52+00:00

I’m using Ruby on Rails to develop a web application. I have a wiki

  • 0

I’m using Ruby on Rails to develop a web application.

I have a wiki article system as part of my project.

As part of the wiki, articles can be linked to authors, and those links also need to be tracked by the revision system. Authors is an attribute of the Article as a whole, and not related to who enters particular Revision, and is a list that is updated over time along with the other wiki attributes.

Right now, I’ve got it setup and working as follows with a central Article model, which has_many Revisions, which has_many AuthorCredits:

class Article
  has_many :revisions
end
class Revision
  has_many :author_credits
end
class AuthorCredit
  belongs_to :revision
  belongs_to :author
end

While this works, it’s pretty awkward, in that I have to build a whole additional set of joins (in the form of AuthorCredits) each time I make a new Revision, no matter how small. Furthermore, there’s quite a bit of additional complexity inherent in using this approach with my actual models that makes this really quite complex and fragile.

I’m thinking about reducing the whole thing into just the Article model, and adding a serialized Array to the model that’s a list of authors. Essentially, I’d be moving the join table into a serialized text field. Then I could just slap on an out of the box revision tracking plugin like Paper Trail, and have an extremely clean model schema.

Has anyone ever done anything like this before? I’ve never heard of it, so I’m worried this might be a crazy idea, but my current situation is so complicated/fragile that I’m seriously tempted.

One huge loss I see right off the bat is that I wouldn’t be able to call database operations anymore like join directly on my data. I assume this would also kill my ability to use convenient Rails methods like belongs_to :authors. Together this means I would entirely lose the ability to go in the opposite direction, and see all things credited to a particular Author, and that alone might kill this entire idea unless I can figure out a way around it. I might compromise by having a set of joins for the current AuthorCredits, but store them also as a serialized Array so that it’s still tracked in that manner, but then reversions become problematic with off the shelf solutions, and I’d have to modify Paper Trail or whatever I use to handle rebuilding or removing AuthorCredits when reverting.

How would you handle modeling a system like this?

  • 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-05-15T12:42:53+00:00Added an answer on May 15, 2026 at 12:42 pm

    Yes, its a bad idea! You lose out on the power and flexibilty of having a database plus you have an excedingly awkward data structure to manage.

    You could perhaps adjust your model.

    Change the relationship so that “AuthorCredit” is a “hasmany” of “Article”.

    Then you can then either add a “from revision” to “to revision” attribute to the relationship or just accept that you only want a list of current authors.

    You would only need to add an Author Credit on the revision they first appear in and you can mark them as dropped by merely setting the “to revision: attribute when they are dropped.

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

Sidebar

Ask A Question

Stats

  • Questions 452k
  • Answers 452k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer See DotRas library. It works well ! May 15, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer Use Python Twisted. It has wxPython integration with twisted.internet.wxreactor and… May 15, 2026 at 9:06 pm
  • Editorial Team
    Editorial Team added an answer $ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -O3 -arch armv7 bar.c -c May 15, 2026 at 9:06 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.