Displaying 20 results from an estimated 7000 matches similar to: "DateTimes get converted to Dates in XML-RPC????"
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 11
3
Datetimes differences
I want to obtain datetime differences in mins in an other column, in front of my
datetimes. I have tried this :
T1 <- c("12/31/03 23:49","1/1/04 1:14","1/1/04 0:02")
T2 <- c("1/1/04 0:58","1/1/04 1:16","")
toto <- data.frame(T1,T2)
toto
y <- strptime(T1,"%m/%d/%y %H:%M")
x <- strptime(T2,"%m/%d/%y
2006 Jun 07
1
Web Service: NoMethodError (missing attribute: featured) !?!?!?!?!
Hi all -
I have a Player model. The database looks like this:
+-------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| fname |
2008 Mar 20
4
Blank DateTime versus Nil DateTime
Hi!
These days I have been having trouble with a test that tried to test
DateTime functionality. I have discovered that a NULL DateTime is
auto-type casted to NIL by Rails.
My problem here is that I have a field :datetime and I want to allow
NULL datetimes but not wrong datetimes. With this validation if deadline
is wrong or if is is blank it returns true. How I can accomplish this?
protected
def
2006 May 29
1
MySQL Datetime Format confusion
I have a column in a mysql table called "start_date" as a datetime. I''m
returning the results from that table as XML.
render :xml => @mystuff.to_xml
However, instead of coming across like:
2006-05-28 00:00:00
It comes across in the XML instead as:
2006-05-28T02:00:00-04:00
Is there a way to make it match the mysql format, or another way to have it
generate XML so the
2006 Jul 30
1
Bug? find_by_id(nil) returns object just created
Tried to submit a ticket in Trac, but it reported an error...
Doing a Model.find_by_id(nil) after creating an object of type Model returns
that object -- and the next time, returns nil. It should always return nil.
For example,
Step 1. Create an object:
>> Foo.create(:name => "bar")
=> #<Foo:0x2aaaac3ade20 @new_record=false,
2007 Mar 07
4
Strange Problem With Unwanted, Transient Caching
Hello,
I hope somebody can explain to me what''s going on here because I''m
baffled!
In a controller''s action I want to create a new order for a
customer. Because I post back to 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
2006 Jun 27
3
find_by_id vs. find in postback action
I''m playing around with the Postback action recipe listed in the recipes
book.
Here is the default code given:
def edit
@recipe = Recipe.find_by_id(params[:id]) || Recipe.new
if request.post?
@recipe.attributes = params[:recipe]
redirect_to :main_url and return if @recipe.save
end
end
Here is what my code sort of ended up looking like, altho i''ve ripped it
apart
2012 Aug 01
2
'redirect_to' taking infinite loop.
Hi,
The following controller method taking me into infinite loop. Once the
update action completes I want to reload the ''index'' page. May I know
why it is going into infinite loop?
def update
Device.find_by_id( params[:device_id] ).driver = (
params[:driver_id] == 0 ) ? nil : Driver.find_by_id( params[:driver_id]
)
redirect_to :action => :index, :tab =>
2006 Jul 13
2
find_by_id(nil) does not always return nil
I have a model named User. When running this application from the
console I can call User.find_by_id(nil) and it returns nil. When running
this application during testing or through WEBrick or Mongrel calling
User.find_by_id(nil) returns the newest record in the database. But it
only does this the first time you call it with nil. The second time you
call User.find_by_id(nil) it returns nil.
2007 Dec 04
1
spec''ing shared controller methods
I want to isolate and spec methods that are shared by controllers,
and live in application.rb.
Whereas I usually also provide examples in individual controllers
that use these methods, not necessarily all the edge cases and I''d
like to isolate the examples.
This is the approach I''m taking (thanks to bryanl for suggestions and
http://pastie.caboo.se/123626). WDYT?
This
2006 Apr 25
1
DateTime problem in AWS
I am trying to implement a web service that returns a datetime stamp as
part of the structured object returned in the response. As noted in
another post (http://www.ruby-forum.com/topic/59762), there seems to be
a problem with the DateTime.parse method in that it does not match the
year. Is anyone aware of workaround for this issue?
My current idea (a hack, but it seems to work) is to
2006 Jul 17
18
Inserting datetime value into SQL Server
I have a SQL Server column named StartTime of (SQL Server) type datetime
If I attempt to set the attribute using
public
def StartTime=(time)
write_attribute(:StartTime, "{ts ''1899-12-30
#{time.hour}:#{time.min}:#{time.sec}''}")
end
it''s inserting a NULL value.
Anyone else able to successfully insert a date time value into a SQL
Server table using
2006 Jan 20
1
XMLRPC::DateTime from AWS
When I do an XMLRPC webservice call to retrieve a single Product, my
DateTime fields in the products table do not get converted to a valid
DateTime value, but remain as XMLRPC::DateTime structures.
So, say my webservice call is:
@product = @aws.get_product(1)
Then my @product object looks like this:
name: My product
last_updated: #<XMLRPC::DateTime:0x37c5338>
description: This is my
2006 Mar 01
2
Validating that a foreign key is present and ok
How do I validate that a model object''s attribute is a valid foreign
key? The problem is, I can''t check if the attribute is a valid foreign
key if the attribute doesn''t even exist.
For example, every employee must be in a department. In the following
code, if an employee''s department_id is not present then
Department.find_by_id(department_id) might cause
2006 Jun 15
8
rails saves it to the database and I don''t want to
Hello:
I am developing a web application to book machines for an event.
so I have an event model
class Event < ActiveRecord::Base
has_many :datetimes
...
end
and a datetime model
class Datetime < ActiveRecord::Base
belongs_to :event
...
end
I have developed a view with the event information and information for
the datetimes. and in the event_controller when I capture a datetime I
2006 May 31
3
detecting changed data
I am working on an application where there are many different screens to
access the data in a particular record/row. I have links to each data
entry screen at the top. Is there a way to detect whether the current
hash has been changed from the stored record so I can prompt the user if
they attempt to change screens without having saved their changes to the
data?
Craig
2008 Jan 13
3
right usage of bdrb
Hi,
i''m going to implement a syndication-service, which will get lists in
xml with some meta-data an enclosed video files, which will get encoded
at the end. The syndication run will be startet every five minutes of
a full hour.
So i thought to build 4 Worker. One for checking which feeds to
syndicate (syndication_worker) at a specific time, one for processing
the list
2010 May 24
3
ActionController::DoubleRenderError
def dispfriends
@myfriend=[]
@myfriendlogin = []
i=0
@currentgroup = Group.find_by_id(params[:groupid])
puts @currentgroup.id
@currentfriends=
GroupFriend.find_all_by_user_id_and_group_id(current_user.id,
@currentgroup.id)
for n in @currentfriends
@myfriend=n.friend_id
@myusers = User.find_by_id(@myfriend)
@myfriendlogin[i]=@myusers.login
puts @myfriendlogin[i]
i=i+1
respond_to do
2006 Jul 14
1
error with Dates in SQL Server
An application that run without flaw last week has been reported to
crash with an error that says that a conversion from char to datetime
has given a date outside range.
This very application runs OK today in production (fortunately :-),
and the difference in both SQL Servers is just that the one where the
exception has started to appear has Spanish conventions. I can''t give