Displaying 20 results from an estimated 10000 matches similar to: "created_at timestamp bug???"
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
2006 May 10
3
migrations :timestamp becomes :datetime in mySql
For some reason whenever I try and create a timestamp column with
migrations and mysql I get a datetime column instead. That''s kind of
annoying because I want the column to update every time the row gets
changed. Is this a bug, or is there something I can do about it?
(Obviously I can manually change my mysql table, but that kind of
defeats the point of migrations!)
In my migration
2006 Feb 25
0
Dumper, mySQL adapter and TIMESTAMP ... something strange ?
Hi,
As explained by MiKael Navarro in the following post
(http://www.ruby-forum.com/topic/55662#new) it seems that there''s a
problem with the way the mySQL adapter treats the TIMESTAMP column.
Actually, when an SQL schema with for example:
created_on TIMESTAMP
is dumped into ruby schema, it will lead to:
t.column "created_on", :timestamp, :limit => 14
but if we
2010 Jul 19
1
How to write your own created_at/updated_at?
I''m using Pfeed(http://github.com/parolkar/pfeed) plugin for User
Activity Feeds.
It creates PfeedItem model records and uses created_at field for a lot
of stuff inside.
Now I need to export/import those user logs. I do exporting to YAML.
When I reconstruct PfeedItem AR object from YAML, it have real(old)
creation time in created_at attribute. When I save this PfeedItem -
there is new
2009 Nov 06
0
Nested objects not propagating from view
I thought I had this fixed, but apparently not. It works okay from the
console, but not from the view. I have the following:
# partial schema
create_table "users", :force => true do |t|
t.string "login", :null => false
t.string "first_name"
t.string "last_name"
t.string "email", :null => false
2006 Feb 07
0
complicated search/model question
Hi,
I have the models and db below and am putting together a scheduling application.
With what is laid out below (or any suggested changes) how would I find a
contractor for a job based on the contractor being available on a specific
weekday, at a specific time and not currently booked in to a job during the
same time?
I?m new to Ruby and Rails and making pretty good progress but I must admit I
2006 Aug 02
2
mangle ActiveRecord
Dear Gurus on Rails!
How do I change the behaviour of one method in
ActiveRecord::ConnectionAdapters::SchemaStatements ?
Full story:
I''d like to mangle
ActiveRecord::ConnectionAdapters::SchemaStatements
so when it creates a new sql table, it also (optionally) creates my
created_at, deleted, key_id, session_id etc columns that I use on basically
all tables.
It would not be DRY to repeat
2006 Mar 17
3
RoR problems with Created_At and PostgreSQL
So, I wrote some pages which essentially created some articles which are
saved to a database, which also include both the "magic" rows
''created_at'' and ''updated_at''.
Now, on my development machine I''m running the MySQL-database and
everything worked as I wanted it to. On the live server I''ve had to
switch to PostgreSQL 8.1 due to
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
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
2006 Jun 11
2
Easy created_at/created_on question
I have an easy question that I can''t seem to find an answer to. When I have
a table with a created_at or created_on column I''ve read that Rails will
automatically update these because they are "magic" column names. I assumed
that since this was all supposed to be done in the background that these
columns would not show up in the standard forms that are created by the
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
2006 May 27
0
Typo 1055 created_at Vs. published_at
[Couldn''t post this to the Typo forum, hope it''s Ok here :-)]
Before I go off and create a Typo ticket, I''d like to know if anyone
else is experiencing this and what there thoughts might be on the
subject?
In Typo 1055, if you use the admin interface and change the published
date for an article, you will get "post not found", when you click on
the article
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 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
2009 Jan 17
0
Created_at date/time if off by UTC-5 hours ?
Hello -
My model has created_at and updated_at which get set automatically, as
expected, but the time is 5 hours off. For example, if I create a new
record at 7:15:25 AM the created_at time shows 12:15:25.
I suspect this has to do with my time zone (Eastern Time, United
States). But if I do a Time.now, it shows the correct time.
Does the Timestamp class use a different zone than the Time
2010 May 25
1
find_by_sql timestamp parameter
Hi
In controller I have this query:
@price_stat = Price.find_by_sql("select id, cost, tour_id,
unix_timestamp(created_at) from prices")
when I try to display result''s created_at column I don''t have any
results:
<% @price_stat.each do |p| %>
<p><%= p.created_at %></p>
<% end %>
result is empty
But if I try without unix_timestamp. ie:
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,
2006 May 30
3
Help about CMS - newbie in RoR
Hi team, I''m a very newbie RoR user from Spain and I''m developing a
blog''s CMS. Why RoR?, coz I think it''s an amazing framework with many
posibilities, portable and really powerful, with a young and optimist
community, and taking my project I''ve prefered his structure in front of
LAMP. Another thing is that I''ve liked to surprise my masters