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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:56:34+00:00 2026-06-08T09:56:34+00:00

In Rails application I want to be able to store schema-less objects — JSON

  • 0

In Rails application I want to be able to store schema-less objects — JSON data structure, that could have different structure from object to object, or for the same object at different times.

With ElasticSearch I can do this. However I would like to be use some kind of ORM with Rails for this.

Tried to do some testing with Tire tutorial, doing this in Rails console:

>>> c = Article.new :title =>'New article', :content => { :a => 'a', :b => 'b'}

I can see that content data stored as serialized YAML:

>> Article.last.content
=> "---\n:a: a\n:b: b\n"

This will require parsing search result to JSON, which is not a problem. But main question: will I be able to search inside serialized data? Is there a way to return attribute names from arbitrary structured data (like Object.keys)?

If not Tire, is there other solutions to do 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-06-08T09:56:36+00:00Added an answer on June 8, 2026 at 9:56 am

    Not really sure what you’re up to here, but Tire does come with a drop-in replacement for ActiveRecord integration, just include Tire::Model::Persistence in your class. You may also define properties (with mappings, type casting, default values, etc):

    class Article
    
      include Tire::Model::Persistence
    
      property :title
      property :published_on, type: 'date'
      property :tags,         analyzer: 'keyword', default: []
    
    end
    

    The Tire README and integration tests have all the info.

    Of course you’re able to search inside the content attribute — it’s just a matter of proper mapping.

    If you’re after some specific behaviour, please update your question…

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

Sidebar

Related Questions

I have a Rails application that I want to be able to jump to
I have a non-rails application that I want to use rails active-record migrations with.
I have a Rails application that works with mongodb. I want to deploy it
I have a rails application that I want to add attachments to assets, so
I am building a Ruby on Rails application and I want to be able
In a Rails application I have a situation where I want to update the
I have written an application for an online clothing store in Rails 2.3.5. I
I have a Rails application but after some time of development/debugging I realized that
I have created a simple API for a Rails application using token-based-authentication that supports
Building a rails B2B application that will have various users. I'm pretty clear on

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.