All Questions
6 questions
2
votes
1
answer
119
views
How to load nested json from ActiveSerializer?
I want to develop methods for a JSON import/export system.
With a simple example where we have a cat with paws, I made this :
class Cat < ApplicationRecord
has_many :paws
def json_export
...
2
votes
1
answer
182
views
Deserialized Rails ActiveRecord object won't save to SQL database
Problem: After serializing and deserializing an object, a perfectly valid ActiveRecord model object will not save to SQL database.
The objects are serialized with:
File.open(output_file, 'wb+') { |f|...
1
vote
1
answer
1k
views
What does it mean to serialize/ deserialize a session?
In reading about Rails, I encountered the phrase "rails will read the cookie and deserialize the session", but I don't know what the second part means. I've googled and searched SO, and found ...
2
votes
1
answer
3k
views
Saving and retrieving an Array in Rails
I'm developing an e-learning in Rails and I want to save a set of Arrays to the database, with the aim of tracking a user's progress through the various sections of the e-learning.
I've come across ...
0
votes
1
answer
312
views
Search in mysql database - unserialized data
Situation:
I have user model. attribute "meta_data" in db represents "text" type field.
In model it seriazized by custom class. ( serialize :meta_data, CustomJsonSerializer.new )
It means, when I ...
1
vote
1
answer
2k
views
newbie: append serialized integers into database column and retrieve them back
How Could I store integers (user id's ranging from 1 to 9999) serialized in a database column and retrieve them back?
In my User model I have invites column,
User model
serialize: invites
invites = ...