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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:50:58+00:00 2026-06-08T21:50:58+00:00

I have this ruby function which yields 1095 records MusicTab::FOps.gen_list(‘/fun/Music’) and I want to

  • 0

I have this ruby function which yields 1095 records MusicTab::FOps.gen_list('/fun/Music')
and I want to store them using datamapper. When I do this

MusicTab::FOps.gen_list('/fun/Music') do |arr_f|
@files=Files.create(
:file_path => arr_f[0],
:title => arr_f[1],
:album => arr_f[2],
:artist => arr_f[3] )
end

only 154 records are inserted, I don’t understand what is so special about these records.
If I do this I get nil for p @files.id all the other records other than those 154 records which gets stored.

MusicTab::FOps.gen_list('/fun/Music') do |arr_f|
@files=Files.create(
:file_path => arr_f[0],
:title => arr_f[1],
:album => arr_f[2],
:artist => arr_f[3] )
p @files.id
p @files.title
p @files.album
end

If I just print the values I can see all the values like

counter=0
MusicTab::FOps.gen_list('/fun/Music') do |arr_f|
p arr_f
counter=counter+1
end
counter

please help..
Regards

  • 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-08T21:51:00+00:00Added an answer on June 8, 2026 at 9:51 pm

    try looking at @files.errors. My guess is that you are failing a validation and it isn’t getting saved.

    You can try enabling some Debug logging and see if that helps to isolate the problem.

    DataMapper::Logger.new($stdout, :debug)
    

    It would be helpful to see your Model Definition for the Files object, and a sample of the data that doesn’t get saved, and one that does. The last time I ran into this issue was when I needed to set the size on my text fields as I was overflowing the default.

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

Sidebar

Related Questions

I have this method on ruby which converts a string into a encrypted SHA
I have this ruby script that allows me to enter the name of a
I am using the Mongo Ruby driver and have this block of Ruby code
Possible Duplicate: Why do this Ruby object have two to_s and inspect methods that
I have a Ruby application, and here is my setup: I have this HAML
The default in Ruby on Rails is to have this set to false (in
I install plugin open_id_authentication and have this error: /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to
Let's say I have a hash in Ruby like this: d = {1 =>
I'm new on both this site and ruby on rails! I have a common
I have some ruby code like this: my_hash = { key1: value, key2: value

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.