activerecord
What are some techniques for testing optimizations to ActiveRecord bulk model object creation?
I am in the process of optimizing a contact importer tool that process a large list of email address and creates contact objects.[详细]
2023-04-10 03:45 分类:问答ActiveRecord includes to_json doesn't include relations
I have a model find like this for an API: Article.includes(:comments).all When applying the to_json method, I\'d like to get back the article along with an array of the comments. Unfortunately, the[详细]
2023-04-10 03:41 分类:问答Rails search with OR in ActiveRecord::Relation
After a very long search I\'m finally asking this question: How do I do OR condition queries with ActiveRecord::Relation in Rails 3.0? Basically I believe it has to do something with scoping and stuff[详细]
2023-04-10 03:22 分类:问答Active Record accepts nested attributes for - creating record with overridden class_name
When I save the form (last piece of code shown here) I get an error saying: unknown attribute: person[详细]
2023-04-10 02:30 分类:问答Create_table method/block
I come from a java/c++ background 开发者_开发知识库and I just started learning Ruby. I am having problems understanding blocks attached to methods. This is a method used to migrate a database.[详细]
2023-04-10 00:25 分类:问答Update using Active Record in CodeIgniter
I have a strange problem, maybe I just don\'t understand how Active Record works well enough, but here it is. I\'m trying to update a record with a particular id. For simplicity and testing I\'m just[详细]
2023-04-09 18:41 分类:问答Fake an active record model without db
I feel like I\'ve got to me missing something. I\'m writing a rub开发者_如何学Pythony gem that allows interaction with active record as an add on to its primary function.[详细]
2023-04-09 17:28 分类:问答How do I upgrade from Ruby 1.8.7 to Ruby 1.9.2 for Rails 2.3.8 app?
I have searched all over and cannot find anyone with the same problem. I am testing upgrading a large Rails app running Rails 2.3.8 with Ruby 1.9.2 using rvm and nginx+passenger (currently running on[详细]
2023-04-09 17:09 分类:问答Perform validation only on create using php-activerecord
I am creating a User Model using Codeigniter and php-activerecord and the wiki says I can use \'on\' => \'create\' to have a validation only run when a new record is created, like this,[详细]
2023-04-09 12:26 分类:问答Why does my JOIN still trigger n+1 selects in active record?
PortfolioEngine::Portfolio Load (0.3ms)SELECT \"portfolio_engine_portfolios\".* FROM \"portfolio_engine_portfolios\" INNER JOIN \"portfolio_engine_items\" ON \"portfolio_engine_items\".\"portfolio_id\[详细]
2023-04-09 11:35 分类:问答