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

The Archive Base Latest Questions

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

Note: Full code can be found at http://github.com/basicxman/andrewhorsman.net I have a Tag model and

  • 0

Note: Full code can be found at http://github.com/basicxman/andrewhorsman.net

I have a Tag model and an Article model which are in a HABTM relationship via a Tagging model. When I try to do a find query on Article while including the association, it fails.

ruby-1.9.2-p136 :003 > Article.find(:all, :include => :tags)
  Article Load (0.3ms)  SELECT "articles".* FROM "articles" 
  Tagging Load (0.2ms)  SELECT "taggings".* FROM "taggings" WHERE "taggings"."article_id" IN (1)
TypeError: can't convert String into Integer
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader/association.rb:83:in `[]'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader/association.rb:83:in `associated_records_by_owner'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader/collection_association.rb:13:in `preload'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader/association.rb:19:in `run'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:128:in `block (2 levels) in preload_one'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:127:in `each'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:127:in `block in preload_one'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:126:in `each'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:126:in `preload_one'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:105:in `preload'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:94:in `block in run'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:94:in `each'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:94:in `run'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader/through_association.rb:31:in `through_records_by_owner'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader/through_association.rb:15:in `associated_records_by_owner'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader/has_many_through.rb:8:in `associated_records_by_owner'
... 8 levels...
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:94:in `block in run'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:94:in `each'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/associations/preloader.rb:94:in `run'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/relation.rb:119:in `block in to_a'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/relation.rb:118:in `each'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/relation.rb:118:in `to_a'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/relation/finder_methods.rb:155:in `all'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/relation/finder_methods.rb:105:in `find'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/relation/finder_methods.rb:101:in `find'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.1.0.rc4/lib/active_record/base.rb:444:in `find'
  from (irb):3
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/commands/console.rb:45:in `start'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/commands/console.rb:8:in `start'
  from /Users/basicxman/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.1.0.rc4/lib/rails/commands.rb:40:in `<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'ruby-1.9.2-p136 :004 > 

Here’s what the current records look like:

ruby-1.9.2-p136 :005 > Article.all
  Article Load (0.3ms)  SELECT "articles".* FROM "articles" 
 => [#<Article id: 1, title: "testing", author: "test", content: "ohi", published_at: nil, stage: 0, last_commit_date: nil, created_at: "2011-07-01 07:06:08", updated_at: "2011-07-01 07:06:08", content_html: nil, hash: "84faf770-85de-012e-112f-109add4b71f4">] 
ruby-1.9.2-p136 :006 > Tagging.all
  Tagging Load (0.3ms)  SELECT "taggings".* FROM "taggings" 
 => [#<Tagging id: 1, article_id: 1, tag_id: 1, created_at: "2011-07-01 07:06:19", updated_at: "2011-07-01 07:06:19">] 
ruby-1.9.2-p136 :007 > Tag.all
  Tag Load (0.3ms)  SELECT "tags".* FROM "tags" 
 => [#<Tag id: 1, keyword: "testing", created_at: "2011-07-01 07:06:19", updated_at: "2011-07-01 07:06:19">] 

And the three models,

Article.rb

class Article < ActiveRecord::Base
  has_many :taggings, :dependent => :destroy
  has_many :tags, :through => :taggings

Tag.rb

class Tag < ActiveRecord::Base
  has_many :taggings, :dependent => :destroy
  has_many :articles, :through => :taggings

Tagging.rb

class Tagging < ActiveRecord::Base
  belongs_to :article
  belongs_to :tag
  • 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-23T12:15:23+00:00Added an answer on May 23, 2026 at 12:15 pm

    Found the issue, I had a column in Article named hash, SQLite doesn’t like this.

    See: SQLite3 Error – cannot rollback – no transaction is active

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

Sidebar

Related Questions

I have a directory full of legacy code from a VB6 application. I have
Can someone please derive a concrete example from the following: http://www.urdalen.com/blog/?p=210 ..that shows how
How do I load a Python module given its full path? Note that the
Note : The code in this question is part of deSleeper if you want
Note The question below was asked in 2008 about some code from 2003. As
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
At the moment, I have this run of code: <%=h current_user.notes.collect { |t| t.name
This is the code (now is full): HTML: <div id=content contentEditable=true onkeyup=highlight(this)>This is some
Ok, here is setup. Note the code below is SIMPLIFIED version. PHP 5.2 ENGINE:
I know that a SQL Server full text index can not index more than

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.