similar to: Rails 4.1 activerecord_relation conversion to array problem

Displaying 20 results from an estimated 100 matches similar to: "Rails 4.1 activerecord_relation conversion to array problem"

2007 Oct 11
0
display problem with to_csv
Hi all, I need to export the document as csv file, i have exported successfully, but the problem is not displayed as per my format, in csv file the format is suffuled, i want the orderwise as how i have mentioned in my query, please help me to come out in the order wise. My coding is: @report_data=EdiaUserContact.find_by_sql( "SELECT '''' as ''Title'',
2009 Jul 20
0
No subject
need transcoding to a|ulaw. I am using it with no problems (have g729 licenses as well though). A bit off topic, I have found some extra configuration that is not really in the docs (or I could not find them): fullname=Your full name country=gr language=en city=City province=Province phone_home=+fullinternationalnumber phone_office=+fullinternationalnumber email=your at email.com
2006 Jul 31
0
MY worker won''t stop working
> On Jul 30, 2006, at 5:11 PM, Chris H wrote: > >> Hi Ezra, >> >> thanks for the reply. >> >> There''s a ruby process that appears in top when I fire off the do_work >> method. >> It uses around 30-50% cpu and disappears once all processing has >> completed. >> >> When I try to stop processing using delete_worker I was
2006 Aug 15
1
serialisation
the case: i have two classes: 1) class Contract < ActiveRecord::Base serialize :addons end 2) class Addon < ActiveRecord::Base end Now i do the following in contract_controller: def create @contract = Contract.new(params[:contract]) @contract.user_id = session[:user_id] @contract.customer_id = params[:customer_id] @contract.pending = 1 @contract.addons = Array.new end def update
2007 Jan 08
1
Realtime Voicemail Table Column Name Question
Hi All, In the realtime voicemail table the column 'customer_id' is used, for my purpose, to specify the customers accountcode. The column name 'accountcode' is used in the iax and sip tables. To keep this consistent throughout the tables, is there any reason I should NOT switch the column name 'customer_id' to 'accountcode' in the voicemail table? Does Asterisk
2007 Sep 21
2
ActionWebServer and SOAPFault
I''m really new to RoR and my first task is to write SOAP web service. The problem is that I don''t understand how to send custom SOAPFault messages in case of the errors. For example, I have FindCustomerById API signature: api_method :find_customer_by_id, :expects => [{:customer_id => :int}], :returns => [Customer] And controller: def
2006 May 26
5
scriptaculous - auto complete textbox with a drop down
Hi, I''m using scriptaculous to provide an auto complete textbox - and it works perfectly - but I was wondering if there was anyway to let users navigate the choices using the keyboard i.e the curor keys as opposed to having to use the mouse? Apart from that it''s perfect! :) Cheers, Pete -- Posted via http://www.ruby-forum.com/.
2006 Jul 20
0
Getting joined collections on a form
Greetings, I''m looking for suggestions on how to simplify getting customer addresses on a form: I''m jumping between controller and view several times; alternating between rhtml and rjs, in order to display customers and their addresses on an invoicing form. It''s very messy. I have a one to many relationship between Customer and Addresses, each customer has one or more
2006 Jul 21
0
Selecting customers and addresses in a form (was Getting joined collections on a form)
(Sorry if you have received this twice, I''m having trouble sending mail to the rails list) Greetings, I''m looking for suggestions on how to simplify getting customer addresses on a form: I''m jumping between controller and view several times; alternating between rhtml and rjs, in order to display customers and their addresses on an invoicing form. It''s very
2009 May 14
3
Mysql query is not working
Please, Can anyone help me to execute this query? SELECT * FROM table WHERE customer_id IN (SELECT IF(1 <> 2,''SELECT customer_id FROM customers'',''SELECT customer_id FROM company'')) Regards... -- Posted via http://www.ruby-forum.com/.
2006 Jun 17
2
how to delete a parent record and child records?
Wow, got myself lost as *soon* as I left the hand-holding exercises in the books. I''m trying to set it up so when I click the (scaffold-generated) ''destroy'' link on one (of a list) of parent MySQL records, the children records in a different table get deleted also. Very simple setup: my tables are ''customers'' and ''accounts'' class
2013 Feb 18
6
How to clear ActiveRecord query cache on associations with dynamic table
In part of my application I''m using dynamic tables. I''m aware of the single thread conditions. I''ve tackled some caveats yet - will post a blog about it soon - but there''s one I need help with. Consider 2 models that are associated: Order and OrderLine where Order has many order_lines. Now we set the table names for them:
2007 Mar 07
4
Strange Problem With Unwanted, Transient Caching
Hello, I hope somebody can explain to me what''s going on here because I''m baffled! In a controller''s action I want to create a new order for a customer. Because I post back to the same action (not RESTful I know, but that''s for another day) I use code like this: def edit @order = Order.find_by_id(params[:id]) || Order.new ... end I
2006 Aug 03
0
sql question
In my rails application I want to run something like a report my table is like this id custommer_id oranges lemons Select sum(oranges),sum(lemons) from my table group by " MAGIC GOES HERE " order by custommer_id MAGIC GOES HERE = group by 3 registers...... like this id| customer_id | oranges | lemons 1 | 1 | 5 | 6 | 2 | 1 |
2006 Jun 01
0
OT: Best practice for multi-user select boxes
I''m working on an application where several customers will be using the same database. I want them to be able to build their own entries for various drop-down lists is if they were the only user of the application. I also don''t want to make building the drop-lists any harder than they need to be. I have thought of two ways to do this. I''d appreciate feedback and
2010 Jan 18
0
What's customer_id mean?
hi ,all I do'nt know exactly what customer_id mean? while if i have password i could visit the voicemail box. CREATE TABLE voicemail_users ( uniqueid int(11) NOT NULL auto_increment, customer_id int(11) NOT NULL default '0', context varchar(50) NOT NULL default '', mailbox int(5) NOT NULL default '0', password varchar(4) NOT NULL default '0', fullname
2006 Apr 03
1
Single table inheritance and relations
All, I''ve a question concerning STI in Rails. Let''s say I''ve a Person class and two classes that inherit from Person: User and Customer. In the DB I''ve the people table to store both instances of User and Customer. Now, let''s say I also have Address class, which references a Customer, and each customer has many addresses. How should I name the
2005 Dec 07
3
ActiveRecord::Observer problem
Hi all, I have a problem with an observer. I have a simple observer... class ActivityObserver < ActiveRecord::Observer observe Customer def after_create(model) bind_params(model) @al.action = "create" @al.save logger "#{model.id} : created" end private def bind_params(model) @al = ActivityLog.new @al.user_id = User.current.id
2007 May 12
3
Asterisk High-Capacity Stability
Thanks Alex, some great ideas. I think, however, I'm leaning towards Asterisk at this point- since I have quite a bit of experience there, and very little with SER. At this point, I'm wondering from a dimensioning standpoint, what kind of capacity my machine will have (Dual Core Xeon 2.4GHz 4GB RAM). As I said, I don't plan to do any transcoding. I read the voip-info page on
2009 Oct 29
4
Unknown column 'quotes.organisation_id' in 'where clause': SELECT * FROM `quotes` WHERE (`quotes`.organisation_id = 1036)
Hi, I have a small app that needs to keep track of quotes, and organisations. An organisation can either be the unit who finally receives the goods (the end_user) or and intermediary (customer) (and in some cases both) An Organisation will (hopefully :) ) have many quotes; and a quote can belong to an organisation, either as a customer or as an end_user or both. So the quotes table