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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:01:25+00:00 2026-05-22T12:01:25+00:00

task = {:project=>1000, :order=>0, :partial_image=>nil, :options=>{ :height=>50, :width=>50, :start_row=>1, :start_column=>1, :end_row=>50, :end_column=>50, :scene=>0}} project

  • 0
task = {:project=>1000, 
        :order=>0, 
        :partial_image=>nil, 
        :options=>{
           :height=>50, 
           :width=>50, 
           :start_row=>1, 
           :start_column=>1, 
           :end_row=>50, 
           :end_column=>50, 
           :scene=>0}}

project = redis.hget('active_projects', task[:project])        
=> 
{:name=>"Pov", 
 :tasks=>
        {0=>
            {:project=>1000, 
             :order=>0, 
             :partial_image=>nil, 
             :options=>
                 {:height=>50, 
                  :width=>50, 
                  :start_row=>1, 
                  :start_column=>1, 
                  :end_row=>50, 
                  :end_column=>50, 
                  :scene=>"blabla"
                 }
             }
         }, 
  :id=>1000,
  :image=>"", 
  :options=>
        {:height=>100, 
         :width=>50,  
         :scene=>"blabla"
        }
   }

task[:partial_image] = 'blablabla'    
project[:tasks][task[:order]] = task    # this is line 37

 Failure/Error: completed_task = DPovray::Task.perform(task)
 TypeError:
   can't convert Symbol into Integer
 # ./lib/jobs/job.rb:37:in `[]'
 # ./lib/jobs/job.rb:37:in `block in perform'
 # ./lib/jobs/job.rb:35:in `perform'
 # ./spec/task_spec.rb:22:in `block (4 levels) in <top (required)>'

The code is in https://github.com/Nerian/DPovray

The test that fails can be run with rspec spec/task_spec.rb

  • 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-22T12:01:26+00:00Added an answer on May 22, 2026 at 12:01 pm

    Actually project = redis.hget('active_projects', task[:project]) is returning a string, not a ruby hash. So that is why it fails.

    I am playing with https://github.com/nateware/redis-objects to see if I can do what I want to do.

    Also, instead of doing:

    Redis.new.hset('active_projects', active_project[:id], active_project)
    

    You can do:

    Redis.new.hset('active_projects', active_project[:id], Marshal.dump(active_project))
    

    And it just works, thanks to hash marshaling.

    Nonetheless, I do not consider this a good solution. I don’t like to use Marshaling as it is much difficult do debug by looking at the database.

    Also I just got a:

     incompatible marshal file format (can't be read)
        format version 4.8 required; 123.58 given
    

    So let us discover a different approach…

    edit:

    Now I am playing with JSON.dump and JSON.parse. They seem a better approach.

    Edit:

    I ended up encapsulating this hash into a real object. So I have Project class and a Task class. In each one I define the methods to_json and self.json_create(o) to that they can be convert to and from JSON.

    It works quite well.

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

Sidebar

Related Questions

I have this task for the project with 4 nested subprojects using Maven: For
I got a task to maintain a c# project, I found some code like
I made a custom task in my TFS build to examine my project's GlobalAssemblyInfo.cs
This is a simplified task which I have to solve in real project. In
We're using Trac as the task management tool at the project we work in.
I am trying to use an xmlpoke task to update a VS Project File
I have a simple task. I have an existing project with a web service
Are the keywords used for project, target, task, function, ... in NAnt build files
I'm having an issue with the Attrib task from the MSBuild Community Tasks Project
I am looking for a particular project/task tracking tool with : Ability to define

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.