Displaying 9 results from an estimated 9 matches for "pay_typ".
Did you mean:
pay_type
2006 Jun 19
12
AWDWR- Question
...m
this book. This is in relation ot how one would grab "search"
parameters from web forms to search for records in the database. I
understand the :conditions part of find() but am confused on the code:
1- name = params[:name]
pos = Order.find(:all,
:conditions => ["name = ? and pay_type = ''po''" , name])
2- name = params[:name]
pay_type = params[:pay_type]
pos = Order.find(:all,
:conditions => ["name = :name and pay_type = :pay_type" ,
{:pay_type => pay_type, :name => name}])
3- pos = Order.find(:all,
:conditions => ["name = :nam...
2008 Mar 23
0
Committing a record update to the DB from a test
...nherits from
ActiveRecord:
class Order < ActiveRecord::Base
However, when I try to update or to create a new order within the
test, my changes do not affect the DB:
o = Order.create(:name => ''n'', :email => ''e'', :address =>
''a'', :pay_type => ''po'')
o.save
o.name = ''m''
o.save
order = Order.find(@first_id)
#order.pay_type = ''po''; order.address = ''dummy address'';
order.email = ''d@d.d''; order.name = ''first ammended...
2007 Oct 26
1
post_via_redirect - testing problem
...#39;s a POST request
if request.post?
#make a new object with the form data
@order = Order.create(:name => params[:name],
:address => params[:address],
:email => params[:email],
:pay_type => params[:pay_type])
@order.add_line_items_from_cart(@cart)
#if we saved the order, empty the cart and go back to index page
if @order.save
session[:cart] = nil
redirect_to_index("Thank you for your order")
else
#if it did...
2007 Aug 21
4
[AWDwR] Confused about has_one and has_many
...e last
playground exercise: Add a Table which contains the payment types.
All goes well, but I am not sure whether I should use has_many or
has_one(as in the Playground wiki at
http://wiki.pragprog.com/cgi-bin/wiki.cgi/PT-E-3).
I use the following:
class Order < ActiveRecord::Base
belongs_to :pay_type
...
end
and
class PayType < ActiveRecord::Base
has_many :orders
...
end
Is this right?
Or should I use has_one instead of belongs_to in Order? An order
references to one PayType, Order has one PayType.
I am confused, please help me.
Regards, Thomas
--~--~---------~--~----~------------~-...
2006 Feb 07
11
Possible Rails Security Issue?
...for xxx.xxx.xxx.xxx at
2006-02-06 09:39:32) [POST]
Parameters: {"commit"=>" Continue ", "action"=>"confirm_order",
"payment"=>{"card_type"=>"M", "card_number"=>"0000000000000000",
"pay_type"=>"cc", "card_expiration(1i)"=>"2007", "card_expiration
(2i)"=>"7"}, "controller"=>"store", "customer"=>{"company"=>"Xxxxx",
"city"=>"Xxxxx", "z...
2006 Jul 12
5
DRY version of RoR book PAYMENT_TYPES example
In the book there is an example how to convert DB payment value to more
readable from. PAYMENT_TYPES array is defined and then in your views you
can use it as Order::PAYMENT_TYPES.
The problem is: how should I convert DB values (for example with type
char(1)) to full string representation. I know that I can add a Hash to
a model: IM = {''S'' => ''Skype'',
2006 Mar 29
2
Rake Migrations for Rails 1.1
...t.column "id", :integer
t.column "name", :string
t.column "email", :string
t.column "address", :string
t.column "city", :string
t.column "state", :string
t.column "zipcode", :string
t.column "pay_type", :decimal
t.column "fulfilled_at", :datetime
end
end
def self.down
drop_table :pages
drop_table :users
drop_table :line_items
drop_table :orders
end
end
Any clues?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 28
1
Collection_select problem
I have my customer object with title attribute
: @customer.title
Where title is "Mr","Mrs", etc....
In edit/create from i have:
@titles=["Mr","Mrs","Miss"]
how do i create a selection box that sets itself to the value of
@customer.title??
This doesn''t work:
<%=collection_select(:customer, :title, @titles)%>
Any help would be
2006 Apr 05
16
Migration won''t rollback to specific version?
Hi all,
I''m confused about how migrations work. I''ve been using them for a
couple of weeks but haven''t had any serious rollback issues yet. Just
now I added a field to a table with a migration and ran "rake migrate",
which added the field as expected.
This was in the file db/migrate/007_mymigration.rb, making it version 7.
Later I changed my mind and