search for: customer_id

Displaying 20 results from an estimated 86 matches for "customer_id".

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 Nov 06
2
comparing 2 dataframes
Een ingesloten tekst met niet-gespecificeerde tekenset is van het bericht gescrubt ... Naam: niet beschikbaar Url: https://stat.ethz.ch/pipermail/r-help/attachments/20061106/756382a8/attachment.pl
2007 Feb 28
5
How to use find_options in multi_search
Hello everyone, I''m using multi-search to search in some attributes of two classes. One of the attributes is the id of the customer. For each multi_search I want to do a give the id of the current customer as a parameter. This should only return results for the given customer. My current code looks like this: Folder.multi_search(@search_query, [Myfile]) I noticed in the API you can
2006 Jul 25
2
Authentication design/ideas
Hi all, I''m using acts_as_authenticated for the front end facing part of my site. I have a model called Customer. I now want to protect the admin sides of things. I am thinking of using Ezra''s acl plugin (http://opensvn.csie.org/ezra/rails/plugins/dev/acl_system2/README) for this. My only problem is that I don''t want the model for admin users to be called Customer,
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...
2007 Sep 21
2
ActionWebServer and SOAPFault
...9;'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 find_customer_by_id(customer_id) Customer.find(customer_id) end The requirement from the vendor is that if such customer does not exist I have to send back to client SOAPFault message with faultcode = "error", fau...
2007 Mar 07
4
Strange Problem With Unwanted, Transient Caching
...o 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 noticed that when params[:id] is nil, the finder still retrieves an order -- the order whose id matches the :customer_id which is in my params hash. Weird. I then noticed that if I ran the finder a second time, it correctly returned nil. Weirder. And I found the same behaviour if I replaced the find_by_id with find_by_sql using the SQL statement it generated in the log. A weird clue? Putting all this an...
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 v...
2014 Apr 11
0
Rails 4.1 activerecord_relation conversion to array problem
...nversion of an activerecord_relation to an array using to_a. I did use to_a but looks like rails is doing a select count behind the scenes. Do you know how to fix this? def index order_type = params[:order_type] @oh = OrderHeader.select("orders_header.*, users.username, users.id as customer_id, users.email, users.phone_work, users.phone_home, users.phone_cell"). joins("INNER JOIN users ON users.id = orders_header.customer_id "). where("orders_header.order_type='#{order_type}' and orders_header.customer_id=#{session[:user_id]}"). or...
2013 Feb 18
6
How to clear ActiveRecord query cache on associations with dynamic table
.... Consider 2 models that are associated: Order and OrderLine where Order has many order_lines. Now we set the table names for them: Order.table_name=''v1_orders'' OrderLine.table_name=''v1_order_lines'' Query: OrderLine.joins(:order).where(Order.table_name=>{:customer_id=>1}).all Result: Select v1_order_lines.* FROM v1_order_lines INNER JOIN v1_orders ON v1_orders.id=v1_order_lines.order_id WHERE v1_orders.customer_id=1 So far so good Now we alter the table names: Order.table_name=''v2_orders'' OrderLine.table_name=''v2_order_lines'...
2006 Feb 27
3
Newbie Question
...y databases, with schemas designed by someone who should be strapped to a rocket and shot into the sun. A lot of the design considerations that Rails seems to need to maximize the horsepower are out of the control of developers in many shops. Currently, if I asked for a primary key named "customer_id" in a table named "customers" I would, in a best case, be forced into a DBA Inquisition meeting, and, after some minutes of torture and ridicule, simply be told "no". In short, how much does dealing with ugly data design (and thus ugly data) foul up RoR? I know making...
2011 Apr 01
4
add_column not working in migration for sqlite3
...ith postgres DB but want to change the DB to sqlite3. I changed the database adapter in the database.yml file. When I run the migration most of it was successful but add_column was throwing an error "Cannot add a NOT NULL column with default value NULL: ALTER TABLE "rates" ADD "customer_id" integer NOT NULL". I made the modification and added the columns to the original migration of the table and ran the migration again. Everything seems to work fine. Why is add_column causing rake to abort during migration? Is there any patch for the problem. Regards, Madhusudhan. --...
2005 Dec 07
3
ActiveRecord::Observer problem
...< 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 @al.customer_id = User.current.customer_id @al.object_type = model.class.name @al.object_id = model.id end end and class ActivityLog < ActiveRecord::Base set_table_name "activity_log" end in my local_environment.rb require ''lib/activity_observer'' ActivityObserver.inst...
2006 Jun 17
2
how to delete a parent record and child records?
...9; and ''accounts'' class Customer < ActiveRecord::Base has_many :accounts, :order => "cmp_code" end class Account < ActiveRecord::Base belongs_to :customer end I used migrate to create the tables. The table ''accounts'' has a field called customer_id (int). It was easy to add a "add new account to this customer" form to the show.rhtml for my ''list'' view. That works great. And I can destroy a customer record just fine (using the auto-generated destroy link). But I can''t figure out how to also destroy the...
2006 Jul 31
0
MY worker won''t stop working
...hed_processing_cdr) @process_class.process_records do |record| PhoneServiceRecord.new do |phone_service_record| phone_service_number = PhoneServiceNumber.find(:first, :conditions => "number = ''#{record[:charged_party]}''") customer_id = 0 customer_id = phone_service_number.customer_id if phone_service_number != nil phone_service_record.date_time = record[:date_time] phone_service_record.duration = record[:duration] phone_service_record.originating_number = record[:originating...
2009 Oct 29
4
Unknown column 'quotes.organisation_id' in 'where clause': SELECT * FROM `quotes` WHERE (`quotes`.organisation_id = 1036)
...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 has fields customer_id:integer, and end_user_id:integer. The Organisation class has "has_many :quotes" and the Quotes class has "belongs_to :customer, :class_name => ''Organisation''" and "belongs_to :end_user, :class_name => ''Organisation''"....
2007 Jul 18
16
Edge Rails namespaced routing
Hi, I was wondering if anyone came across a similar scenario when working with namespaced routes with edge rails. Consider an application with controllers customers and products that also have other resources. map.resources :customers do |customer| customer.resources :notes customer.resources :tags end map.resources :products do |product| customer.resources :notes customer.resources
2006 Jan 13
4
Single Table Inheritance (this is my 3rd post :( )
...::Base end class Vendor < Company end class Customer < Company end class Agent < Company end Now I have a active record Association class QuoteSheet < ActiveRecord::Base belongs_to :customer has_many :vendors has_one :Agent end Now in the table quote_sheets should I use vendor_id, customer_id, agent_id or just company_id since all of them are in 1 table called companies. I have read agile wweb development with rail, and no where it says about relationship like this. Thanks with best regards, Vikrant
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 @contract = Contract.find(params[:id]) @contract.user_id = session[:user_id] @contract.customer_id = params[:customer_id] @contract.addons = Addon.find(:all, :conditions =>["user_id = ? &&amp...
2006 Apr 03
1
Single table inheritance and relations
...Can it be done in the simple way without specifying column names? If it can, then what should be the column names? Ex. class Customer < Person has_many :addresses end class Address < ActiveRecord::Base belongs_to :customer end Now, if I call the referencing column in addresses table customer_id, it won''t find the people table and if I call it person_id, then Customer.find(:first).addresses will generate bad query, because addresses table doesn''t have customer_id. So, should I put all the relations in base class (Person) to make it work, and just ignore the fact that...