Displaying 9 results from an estimated 9 matches for "pay_types".
Did you mean:
pay_type
2006 Jun 19
12
AWDWR- Question
I''m having a particularly difficult time undersanding one lesson from
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 =
2008 Mar 23
0
Committing a record update to the DB from a test
Hi all, I hope someone can help me with this.
I''m trying to write a test to see if my versioning (acts_as_versioned)
works. In order to do that, I have a class which inherits 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 =>
2007 Oct 26
1
post_via_redirect - testing problem
I''ve got an integration test that''s failing but i can''t work out why:
Here''s the action being tested - in case anyone recognises it, it''s
based on the Depot app in Agile Web Dev with Rails.
def checkout
@in_checkout = true
#don''t let user checkout with an empty cart
if @cart.items.empty?
redirect_to_index("Your cart is
2007 Aug 21
4
[AWDwR] Confused about has_one and has_many
Heya everyone!
I am quite new to Rails and I am reading AWDwR. I am at Task E "Check
Out!". I understand it quite well, but I have a problem with the 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
2006 Feb 07
11
Possible Rails Security Issue?
I have an e-commerce site and users check out with a form. The
results of that form are sent to a "confirm your order" page via
POST. I take great pains to NEVER store the full credit card number
on my server--just the last 4 digits. I was very surprised to find
that by default Rails will record POST requests with parameters in
the production.log. And those parameters
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
Hi all. I keep having the following error when I invoke the rake
db:migrate command for Rails 1.1 (Ruby 1.8.2 -- Windows 2000)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== Realtorex: migrating
=======================================================
-- create()
rake aborted!
undefined method `create'' for
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