similar to: Shouldn't ranges work for datetime fields

Displaying 20 results from an estimated 13000 matches similar to: "Shouldn't ranges work for datetime fields"

2006 Apr 25
2
DateTime format YYYY-MM-DDTHH:MM:SSZ ????
Hi all - Implementing my first web service with rails and trying things out using the "/controller/invoke" interface. Mostly works fine. But I have a function that takes a datetime and returns all rows that are newer than that. According to the log the SQL it''s generating is this: SELECT * FROM xxxx WHERE (created_at >= ''2006-04-25T13:18:31Z'') I have
2005 Nov 20
1
mySQL 5.0 upgrade - incompatible DateTime format?
I''ve upgraded to mySQL 5.0, and it''s gone pretty smoothly except that on DateTime.now doesn''t seem to return a value that mySQL likes any more, as seen in the following exception: Incorrect datetime value: ''2005-11-20T15:33:12-0800'' for column ''logged_at'' at row 1: UPDATE notes SET `due_on` = ''2005-11-20'',
2006 Jan 20
47
SQL Server datetime error
i have a problem with the datetime format of rails. i am unable to save a dataset to the db. here''s the error message -- the original error message was in german, so i translated it -- i get: DBI::DatabaseError: Execute OLE error code:80040E07 in Microsoft OLE DB Provider for SQL Server Couldn''t convert a char-Datatype to datetime HRESULT error code:0x80020009
2008 Sep 12
1
restful_authentication rspec failures "Mysql::Error: Incorrect datetime value:"
I am getting 193 failures that all have "Mysql::Error: Incorrect datetime value:" how do i fix this??? i am new to rspec and restful_auth, so if i am doing something wrong, let me know!!! windows xp rails 2.1.1 rails testproject cd testproject # create my databases and edit database.yml git init git submodule add git://github.com/dchelimsky/rspec.git vendor/plugins/ rspec git
2007 Sep 24
3
Oracle Date + RoR
Hi Experts, I''ve a model called Product where i''ve column called created_at, updated_at where i''ve made a query based on Oracle date format like date_of_created = ''23-SEP-07'' @product = Product.find(:all, :conditions => ["created_at=?", date_of_created]) but in view its empty. AND EXPERTS I''VE DATA WITH 24-SEP-07 FOR MORE
2011 Apr 27
2
Can not create model instance via params on specific model but can on others....
Anyone have an idea on this? Got a weird situation where on a specific model I can not create an instance using params, yet it works fine on other models. The model which does not work is a stock model, there is no logic in it. Ruby 1.8.7/Rails 3.0.5. Does not work: (rdb:1) PaymentTransaction.create(:purchase_id => 3) #<PaymentTransaction id: 2, purchase_id: nil, action: nil, amount: nil,
2005 Dec 19
3
created_on, created_at defaulting to 2000/01/01 00:00:00
Hello all, Rails 1.0.0 created_on is being set to 2000/01/01 00:00:00 Any ideas on this ? Thanks! Schema is create table user_login_history ( id int identity(1,1) not null, user_id int not null, created_on datetime default(getdate()) not null, created_at datetime default(getdate()) not null, updated_on datetime default(getdate()) not null, constraint pk_user_login_history primary key clustered
2008 Oct 06
1
Rails console, saving objects
I was reading a book and following the instructions in it. >> class Story < ActiveRecord::Base; end => nil >> story = Story.new => #<Story id: nil, name: nil, url: nil, created_at: nil, updated_at: nil> >> story.class => Story(id: integer, name: string, link: string, created_at: datetime, updated_at: datetime) I do not remember me asking for id, name, link or
2009 Jul 04
3
scaffolding
hi , i used the folllwing command to scaffold, G:\my\webblog>ruby script/generate scaffold webblog id:integer title:string body :text created_at:datetime after when i migrate with the follwing command rake db:migrate i got the error as (in G:/my/webblog) == 1 CreateWebblogs: migrating ================================================ -- create_table(:webblogs) rake aborted! Mysql::Error:
2007 Oct 25
1
find - group - postgres
I am not sure that this is entirely a rails question as I am trying to run the command in postgres and I am getting the same error... controller code... @client_slot_count = ClientSlotsDaily.find(:all, :conditions => ["created_at > ? AND created_at < ? AND facility_id = ? AND client_id IS NOT NULL", starting_date, ending_date, @facility.id],
2010 May 25
2
Site Navigation With Polymorphic Has Many Through
Hi, seem to keep running into a wall here. I can''t find any resources on site navigation that can deal with any model being in the nav, allow nesting, and can dynamically update. So I thought about it for a while, and decided on a MenuItems class, which contained the position of the child in relation to it''s siblings, where the parent and the child were polymorphic. Then a given
2007 Jul 08
2
datetime_select, is creating an instance of the Time class
Hello It seems that datetime_select, is creating an instance of the Time class. Why would that be? I found this while building a site where people can create vigils (prayer vigils, peace vigils, etc). When I added a validation method that compared start_date to created_at, it generated the error: ArgumentError (comparison of Time with DateTime failed): I was able to put a breakpoint in the
2006 Feb 11
2
Migrations and Unintialized Constants Error
I am running into a problem with two of my tables and the "uninitialized constant" error when using migration. I get the "uninitialized constant Note" when running the following code in my migration file: create_table :notes do |t| t.column :id, :integer t.column :noteshare_id, :integer t.column :title, :string t.column :covered, :string
2008 Jul 13
2
Problem with ActiveRecord::AssociationTypeMismatch
Hi all ! I''ve written a Character model, each character has many Attributes. My schema.rb looks like this: create_table "characters", :force => true do |t| t.string "first_name" t.string "last_name" t.integer "user_id" t.datetime "created_at" t.datetime "updated_at" end create_table "attributes",
2006 Jun 09
1
Updating Fields In Migration for HABTM Relationship
Earlier I forgot to add updated_at and created_at columns for my HABTM relationship so I created a migration to add them. In the migration I also want to go back and set the value of the created_at and updated_at columns for the previous rows. What is the best way to do that? Initially I thought I was being smart and decided to put an UPDATE SQL query in a find_by_sql statement and
2009 Nov 11
4
Schema dump does not reflect column size limit
Hi, Everything is in the title. With Rails 2.3.4 and MySQL 5.0.41: If have a table like this: +----------------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------+------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL |
2006 Aug 02
2
many-to-one relationship, do I need a second table?
Ok, to keep things short. Im wondering if I need a secondary relationship table to handle my many-to-one relationships. Here is an example of what I''ve written down. For instance say I want to find all of the people in a given location. class Location < AR:Base has_many :people end class Person < AR:Base belongs_to :location end My SQL tables look like: CREATE TABLE
2007 Nov 02
3
Date Issues + Oracle + RoR
Hi Experts I''ve a product like this ID -> 1 Name -> Xyz Price -> 30 Created_at -> 02-NOV-07 from_date = Date.new(2, 10, 07) to_date = Date.new(2, 10, 07) @product = Product.find_by_sql("select * from products where created_at between from_date and to_date") code works perfectly, buy my issue is i dont get any data. always says no record found but if i use
2006 Jan 03
1
find_by datetime question
Hi, I was wondering if any of you Rails/SQL ninjas knew of an elegant way to grab from activerecord all the rows that are within an interval of the current time (say in the last week). For instance, if there''s the created_on datetime column, is there a zippy way to use find() without SQL? It seems like the Ruby DateTime object doesn''t really do intervals for numerous
2006 Jan 07
1
How to DRY with Fixtures (helper or extend Time class, how)?
I have a test/fixtures/users.yml like so: apa: id: 1 username: apa [...] created_at: <%=Time.now.strftime("%Y-%m-%d %H:%M:%S")%> updated_at: <%=Time.now.strftime("%Y-%m-%d %H:%M:%S")%> I don''t like how I''m repeating myself with the strftime bit. Is there some shorter Time method to format time for a (MySQL) datetime field that