similar to: eager loading not working in production mode

Displaying 20 results from an estimated 800 matches similar to: "eager loading not working in production mode"

2008 Nov 10
3
to_xml and helper methods
Hi, I have an array with objects and I want to generate an XML like: <objects> <object> <category_id>1</category_id> <helper-method>result 1</helper-method> </object> <object> <category_id>2</category_id> <helper-method>result 2</helper-method> </object> </objects> The helper
2008 Nov 13
5
Touch an ActiveRecord - timestamps
When I update an ActiveRecord, i would like to "touch" one of the related objects, that the updated record belongs_to, in order to update the timestamps on the parent record, although i don''t want to change any of the data in the parent. Whats the accepted way to do this? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You
2009 Feb 24
3
Free SMS limit (using sms_fu)
I have been using SMS_fu but it seems too good to be true for production. I''m wondering, is there any sort of limit on email to sms depending on the carrier that you can send in a given amount of time? I remember reading somewhere that there is a limit to the number of free email to sms that you can send through AT&T in a given month. Does anyone know anything aobut this? I guess I
2007 Aug 21
3
Eager Loading
is there a way to always eagerly load an associated object so that you don''t have to put :include into every finder? class Product <ActiveRecord::Base belongs_to :user #always load user when product is loaded end Product.find(1).user.login #1 query since user was loaded with the product, same as if i used :include but I don''t want to have to specify it everywhere.
2009 Feb 18
3
wrong number of arguments (1 for 0)
Hello, I am new to ruby on rails. When I tried to create a session I am getting an error, ''wrong number of arguments (1 for 0)'', in my controller. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ArgumentError in CustomerController#add_to_cart wrong number of arguments (1 for 0) RAILS_ROOT: /project/bob_shopping Application Trace | Framework Trace | Full
2009 Oct 15
10
AJAX - how to have multiple select form sets implemented?
hi, there :) Consider a blogging application whereby a user is trying to add a new blog. He/she has to select a category. Upon selecting a category from a drop down box, a new sub categories drop down box will be created (hence an AJAX call). Got this implemented and it''s ok. Now, let''s assume that a given blog can have multiple categories (and subcategories). For example, a
2010 Aug 10
3
ActiveRecord::UnknownAttributeError: unknown attribute: <script type
Has anyone seen this happening to their apps? I''m starting to get errors like this come across from one of my apps: ActiveRecord::UnknownAttributeError: unknown attribute: <script type The parameters being sent are: {"user"=> {"email_confirmation"=>"someone-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org",
2006 May 03
3
My Tooltips contribution
All -- I've been working on a simple tooltip widget and thought I'd release it into the wild. It builds on the features found in Prototype 1.5.0 RC0 and Scriptaculous 1.6.1. Very basically, it walks down a list of links and if they have id, href and title attributes, displays a tooltip on mouseover. Styled with a few lines of CSS and background images. You can demo it here:
2006 Aug 17
2
validates_associated bug?
i seem to be experiencing a bug where rails tells me that my organization object''s associated credit card is invalid (activerecord validation-wise invalid), when i know it to be valid. this happens only if i tell the organization to validate_associated :credit_card. i know the associated credit card is valid, because a) that credit_card object itself throws no validation errors, and b)
2009 Oct 14
2
How to configure every (postgresql) db connection?
I would like to set some db session variables specific to my application on the database connection that rails uses. They can be set by issuing an SQL command like "SET statement_timeout = 1000" once - it will be in effect for every subsequent SQL statement that uses this connection. So I tried to put the following into an initializer: ActiveRecord::Base.connection.execute("SET
2007 Apr 06
3
@ vs self in models?
i''ve seen both of these syntaxes before and have also used both in my own models: class Foo def get_bar @bar end end and class Foo def get_bar self.bar end end seemingly with no difference... i''m a nuby though so could anyone enlighten me to the differences if there are any? thanks, jeff --~--~---------~--~----~------------~-------~--~----~ You received
2010 Mar 28
3
ActionController::UnknownHttpMethod: ***, accepted HTTP methods are get, head, put, post, delete, and options
I''m occasionally getting exception notices with this error message: ActionController::UnknownHttpMethod: ***, accepted HTTP methods are get, head, put, post, delete, and options Anyone ever seen this or know what could be causing it? Thanks, Jeff -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2006 Jan 19
0
Limited eager loads and conditions on the eager tables
Hi, Why are limited eager loads and conditions on the eager tables incompatible? Doing a find(:all) without :include causes a select * query to be generated, which means the id fields everwrite each other if associated tables are included using :joins. But using :include, if conditions are placed on the tables listed in :joins then Rails throws an exception when :limit is included too.
2006 Aug 04
2
problem eager loading with sti
Here''s the setup (working off Rails 1.1.4): Class Project belongs_to :employee Class Employee < Person has_many :projects When I try to paginate(:employees, :include => :projects) I get the error "Association named ''projects'' was not found; perhaps you misspelled it?" I can :include other models that the Person class has_many or habtm of, and if I
2006 Aug 07
1
Eager loading wierdness
Consider this problem. I have an Item that has_many Features I want to find all Items with a Feature name of ''foo''. Normally you would do this.. @items = Item.find(:all, :conditions=>["features.name = ?", ''foo''], :include=>:features) This all works fine and dandy except for this problem. If you do this... <% for item in @items %>
2006 Jul 03
0
Eager loading of ''is meant to be nil'' Associations
If I ''find'' using :include, and some included associations are null, then looping through the array executing ''if obj[i].assoc'' accesses the database for a second time (as obj.assoc is nil). eg Topic, has_many posts Post has_one email and posts = Post.find(:all, :condition => ''posts.topic_id = 10'', :include =>
2006 Jun 19
0
Eager loading and acts_as_tree
Hi all, I have a node structure which acts_as_tree. I am pulling the first two levels under the root node with: @root = Node.find(1, :include => [ { :children => [ :children, :parent ] }, :parent ]) How do I pull out the first three levels? What about four? @root = Node.find(1, :include => [ { :children => [ { :children => [:children, :parent] }, :parent ] }, :parent ])
2006 Mar 01
1
Eager loading problem. Help greately appreciated
Each Timesheet has an employee. An employee has a division and a location. I want to find all the timesheets with a status of 2. I then iterate over the timesheet collection and print the timesheet name, employee name, employee divison name, and employee location name. Like so: for t in Timesheet.find(:all,:conditions=>"status=2",:include=>:employee) puts timesheet.date
2006 Mar 14
3
cascading eager loading patch not working in oracle
Notice the "AS" keyword appears many times. Oracle does not support this keyword: ActiveRecord::StatementInvalid: OCIError: ORA-00905: missing keyword: SELECT tim esheets.id AS t0_r0, timesheets.start_date AS t0_r1, timesheets.status AS t0_r2, timesheets.cost AS t0_r3, timesheets.charge AS t0_r4, timesheets.employee AS t0 _r5, employees.id AS t1_r0, employees.name AS t1_r1,
2006 Mar 26
0
Eager loading and polymorphic association
Hi all, Is it possible to do "eager loading" with polymorphic associations ? Ex : I have a Page model that acts as taggable. When I do Page.find(:all), I would like to retrieve all tags associated with a page. Thanks, Thomas. -- Posted via http://www.ruby-forum.com/.