search for: date_avail

Displaying 20 results from an estimated 25 matches for "date_avail".

Did you mean: data_avail
2006 Jan 19
file_column error: tmp file created but not actual
...4) [POST] Parameters: {"commit"=>"Create", "wallpaper"=>{"downloads"=>"0", "date_created"=>"Wed Jan 18 23:20:12 PST 2006", "price"=>"0.0", "title"=>"test logger4", "date_available(1i)"=>"2006", "image_temp"=>"", "date_available(2i)"=>"1", "description"=>"test4", "date_available(3i)"=>"18", "date_available(4i)"=>"23", "user_id"=&gt...
2006 Jan 27
testing for nil numeric value in find
In the agile/rails tutorial book the following construct is added to products.rb. def self.salable_items find( :all, :conditions => "date_available <= now()", :order => "date_available desc") end Now, I wish to extend :conditions => to exclude products that have a nil value for the price. I have tried different syntax using "price.nil?", "not", and "!", but h...
2006 Apr 20
checking date
Radrails created a field for date <%= product.date_available.strftime("%y-%m-%d") %> What does this mean? Should the definition be date or datetime? I tried both and no results Jim -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Feb 28
Agile Web Development Example Application Question
...47;store_controller.rb> class StoreController < ApplicationController def index @products = Product.salable_items end end and in the app/models/product.rb I have the new piece of code ____snip____ def self.salable_items find(:all, :conditions => "date_available <= now()", :order => "date_available desc") end _____end snip____ When I try to access the store page, it returns: Couldn''t find Product with ID=all AND date_available <= now() /app/models/product.rb:21:in `salable_items''...
2006 Mar 04
unittest, not loading yml data
Here is my products.yml version_control_book: id: 1 title: Pragmatic Version Control description: How to use version control image_url: /images/sk_svn_small.jpg price: 29.95 date_available: 2005-01-26 00:00:00 automation_book: id: 2 title: Pragmatic Project Automation description: How to automate your project image_url: /images/sk_auto_small.jpg price: 29.95 date_available: 2004-07-01 00:00:00 and I was trying to u...
2006 Aug 07
Unit testing diffculty
ok, let me show you my "products" fixtures file: ram: id: 1 title: RAM description: ECC RAM Registered, 512MB image_url: images/test.jpg price: 29.95 date_available: 2005-01-25 00:00:00 busted_arsehole: id: 2 title: Busted Arsehole description: I have an arsehole, it is-e busted image_url: images/test.jpg price: 999.95 date_available: 2005-01-25 00:00:00 hey: id: 3 title: hey description: testinggggg image_...
2006 Aug 06
Having Problem w/ Agile Web Development book
...dError in StoreController#index undefined method `salable_items'' for Product:Class and here is my store_controller.rb ... class StoreController < ApplicationController def index @products = Product.salable_items end def self.salable_items find(:all, :conditions => "date_available <= now()", :order => "date_available desc") end end What am I doing wrong? -- Posted via
2006 Dec 04
uninitialized constant Product
...age 73 where I did ruby script/generate controller Store index, then edited store_controller.rb to class StoreController < ApplicationController def index @products = Product.salable_items end end and product.rb to: def self.salable_items find(:all, :conditions => "date_available <= now()", :order => "date_available desc") end but it keeps showing this error in http://localhost:3000/store/ : NameError in StoreController#index uninitialized constant Product RAILS_ROOT: script/../config/.. Application Trace...
2006 Apr 01
how to use datepicker
This is the webpage: I have downloaded and installed it. But how do I use in view page? This is the usual view with ordinary datetime_select: <p><label for="product_date_available">Date available</label><br/> <%= datetime_select ''product'', ''date_available'' %></p> So I have table named ''product'' with one of the column named ''date_available''. How do I use d...
2007 Oct 07
Rails to English
I am currently using the book "Agile Web Development With Rails" (2005). I am working on a fully function web application that has a shopping cart. The web page displays this, ActiveRecord::StatementInvalid in AdminController#create Mysql::Error: #23000Column ''date_available'' cannot be null: INSERT INTO products (`image_url`, `date_available`, `price`, `title`, `description`) VALUES('''', NULL, ''9.99'', ''asdf'', ''asdf'') RAILS_ROOT: ./script/...
2006 Apr 26
rake db_schema_dump make syntax error
rake migrate bug with datetime: > rake db_schema_dump produced a bad schema.rb that isn''t valid ruby, it has an invalid default, unless ruby takes bare words: t.column "date_available", :datetime, :default => Sun Jan 01 00:00:00 Arabic Standard Time 2006, :null => false I don''t think the Baghdad time zone should matter. ruby 1.8.4, rails 1.1.2, MySQL 5.0.15, Win XP SP2 mysql> describe products; +----------------+---------------+------+-----+--------...
2005 Dec 31
Test Unit Problem
...encing the following test unit error working with Rails that I can''t fathom. I have a products.yml file which holds the following test fixture for the products table: dell_pc: id: 1 title: Dell PC description: Dell PC image_url: http://.../pc_image.jpg price: 15000.00 date_available: 2005-12-31 06:53:00 I also have the following product_test.rb file to test the fixture above: require File.dirname(__FILE__) + ''/../test_helper'' class ProductTest < Test::Unit::TestCase fixtures :products def setup @product = Product.find(1) end d...
2006 Mar 13
Wilcard search
Hello, I''m writing a search function for my application, but I am unsure on how to search for all results that contain my search string; here''s what I''ve got: def search @products = Product.find(:all, :conditions => "date_available < now()", :conditions => [ "title ilike ?", @params[:search]], :order => "title desc") end It works, but only if I provide a full match to the title - how can I do "title ilike ''%''?''%...
2006 Aug 13
Using ENUM column in table
...drop table if exists products; CREATE TABLE products ( id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, sku varchar(6) NOT NULL, price decimal(10,2) not null, state ENUM (''kansas'',''georgia'', ''new york'') NOT NULL, date_available datetime not null ) CHARSET=utf8; Thanks, Scott -- Posted via
2006 Apr 21
NoMethodError with test_read_with_hash assert_equal vc_book["title"], @product.title assert_equal vc_book["description"], @product.description assert_equal vc_book["image_url"], @product.price assert_equal vc_book["price"], @product.price assert_equal vc_book["date_available"], @product.date_available_before_type_cast end Is there anything I need to tweak in the code to avoid seeing the error again? -- Posted via
2006 Mar 06
Rails MySQL query
Hi, I?m following the Depot tutorial in Agile Web Development with Rails. I need some help to display products thats in one specific category. mysql> select * from products where category = "jackets" does what I want, but I?m not sure how to make a list and display it in rails? This code displays every product with some of its fields, but I want it to only display the products
2005 Dec 30
Problems with Testing (Depot) demo app in Agile Rails book
...#47;store) work any more. (See example error message below) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ActiveRecord::StatementInvalid in Store#index Mysql::Error: Lost connection to MySQL server during query: SELECT * FROM products WHERE (date_available <= now()) ORDER BY date_available desc RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract_adapter....
2006 Aug 14
(no subject)
I have the following code that generates a rhtml page, <%= start_form_tag :action => ''create'' %> <%= render :partial => ''form'' %> <%= submit_tag "Create" %> <%= end_form_tag %> <%= link_to ''Back'', :action => ''list'' %> ...I am trying to put a "Browse" button to
2006 Jul 05
@products = Product.find_by_sql "SELECT *...... "
hello all i have a trouble whit a controller i need filter the collection by a date, but i dont know how to get the values of a date, because i need that values to build my sql sentences for example: @products = Product.find_by_sql "SELECT * FROM products WHERE cdbl(date_availabe) > " + first_date_double_value + " AND cdbl(date_available) <= " + second_date_double_value first_date_double_value & second_date_double_value are the values that i dont know how to get neither taking of value please i need your help tanks -- Posted...
2006 Apr 20
Please help me !
...ind(params[:id]) @products = Product.salable_items1(params[:id]) flash[:notice] = "Succesfully" end I want to acess the varible that is in nthe product.rb file that is model def self.salable_items1(rid) find(:all, :conditions => "cat_id = rid", :order => "date_available desc") end I am unable to access the variblein find method rid How can access that variable.. Thnaks and regards, Sure -- Posted via