I have a model named Article, which I am joining with TwitterShare as shown below:
articles = Article.joins("LEFT OUTER JOIN twitter_shares ON articles.id = twitter_shares.article_id").where("articles.id = ? or articles.id = ?", 27165, 5632).select("articles.id, twitter_shares.user_id")
When I get the articles back, and examine the Article model returned, it returns the user_id as a string, even though the column type in the twitter_shares table is an integer. Why is this? How can I make ActiveRecord return the integer column as an integer, not a string?