Displaying 20 results from an estimated 2000 matches similar to: "find_by datetime question"
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 Jan 22
3
Balancing relevancy and recentness
I was wondering if there was a good way to either balance the relevancy
score with recentness of matching documents- or include the recentness
in the score somehow?
Thanks,
Ben
--
Posted via http://www.ruby-forum.com/.
2006 Mar 23
1
YAML inconsistencies...
I figured I''d post here before submitting a ticket, but I''m seeing some
confusing stuff when dealing with YAML now. I was using it to freeze
objects in my database, and so i had some data already around to mess with.
I upgraded both Ruby (1.8.3 -> 1.8.4) and Rails ( -> 1.1RC1) and this junk
started. I''ve outlined the problem in two pastes, which I''ll
2006 Apr 13
8
DevTower Beta3 Release!
DevTower Beta3! (0.3)
I''m proud to announce some major changes and improvements to DevTower in
this beta release! First and foremost, DevTower is now a full plugin. Also,
DevTower works (only) with Rails 1.1.
==== ABOUT =====
DevTower used to synchronize the development of Ruby On
Rails applications with developers working simultaniously
on multiple systems with Subversion. DevTower
2006 Mar 31
2
A.R. Associations problem
Hello,
I''m learning A.R Associations by creating a simple forum that consists
of 3 tables: ahuthors, topics and posts. This is the schema:
class AddAuthorAndTopicAndPostTables < ActiveRecord::Migration
def self.up
create_table :authors do |t|
t.column :username, :string
t.column :email, :string
t.column :created_on, :datetime
end
create_table
2007 Aug 14
1
find_by_sql vs connection.select_all
I was trying to do SUM based mySQL query simliar to the following:
SELECT SUM(updated_on - created_on) AS total from signups
If I were to run this command in the mySQL console I would get a
result. However, if I were to run it using the following command in
Rails:
Signup.find_by_sql("SELECT SUM(updated_on - created_on) AS total from
signups")
The query that is written to the log is:
2006 May 24
1
AR many-many join tables - can they have created_on, updated_on ?
Hello all,
I''m creating a many-many join table between ''homes'' and ''users''. Can it
contain created_on? will AR update created_on, updated_on on this table?
CREATE homes_users (
home_id int not null,
user_id int not null,
created_on datetime null,
updated_on datetime null
)
Thanks for your advice!
--
------------------------------
Apple MacBook.
2007 Jul 05
1
how to search date with ferret and acts_as_ferret?
Hey all,
How can I search date with ferret? Do I need to submit them in a special format?
Right now I have in my Item model:
acts_as_ferret :fields => [:created_on]
with eg created_on = Thu May 11 17:00:00 -0500 2006
now when I do Item.find_by_content("created_on:<#{Time.now}")
I get nil, I''m probably doing something wrong.
Any idea how to fix it?
thanx in advance
2006 Apr 20
5
Noobie problems with helper
I have the following helper method in application_helper.rb:
def format_date(date)
day = to_s(date.day)
month = to_s(date.month)
time = to_s(date.time)
date = day + "/" + month + " - " + time
return date
end
I am trying to call this method in a view like this:
<%= format_date(bounty.created_on) %>
create_on is a timestamp in mysql. I am
2006 Jan 30
3
Howto change @article.article.headline to @article.headline ?
I have to actions:
def index
@articles = Article.find(:all,
:conditions => "un_published != ''1''",
:order => "created_on desc")
end
and
def group
id = params[:id]
@articles = ArticleGroup.find(:all,
:include => [:group, :article],
:conditions => ["articles.un_published !=
2006 Jan 06
4
"Selecting" a calculated row / Using :select in the paginate method
Hi,
I was trying to use the :select parameter to select a calculated row,
but it appears that the parameter is not picked up by the paginate method.
I want to add the following to the select statement:
timediff(now(), created_on) as age
So I tried:
@story_pages, @stories = paginate :stories, {:per_page => 10, :include
=> ''user'', :select =>
2006 Oct 11
6
Indexing problem 10.9/10.10
Sorry if this is a repost- I wasn''t sure if the www.ruby-forum.com
list works for postings.
I''ve been having trouble with indexing a large amount of documents(2.4M).
Essentially, I have one process that is following the tutorial
dumping documents to an index stored on the file system. If I open the
index with another process, and run the size() method it is stuck at
a number
2006 Jul 01
4
Electronics Workbench 5c + Wine
Hello,
I'm trying to run Electronics Workbench 5c under Wine, but when I try to
run it it shows the main screen then quits with this:
renan@diamond:~/.wine/drive_c/Ewb5$ wine Wewb32.exe
X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 53 (X_CreatePixmap)
Serial number of failed request: 21414
Current serial number in output
2005 Dec 23
4
OO model style: inheritance
Hi everybody
I am totally new to rails and I am trying to start a
tiny project to get familiar with rails. But I already
got my first problem and I would be happy if somebody
could point me in the best and cleanest direction.
I am trying to develop a small gallery app. Since I
would like to add more features in future I am trying
to design a clean OO architecture of my models:
The base object
2007 Sep 04
5
Xml templates...
I was looking in using an xml_builder template to do something like:
blee.xerb
xml.blees do
<% for blee in @blees %>
xml.blee = blee.name
<% end %>
end
It looks like the xml_builder template can''t expand the erb tag.
It this not the correct way to expand and xml template ?
Thanks !
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 May 18
2
How to debug the rendering in Rails?
Hi,
I have some controller code like this:
def mailing_lists
@ml = MailingList.find_by_identifier(@params[:id])
@messages = @ml.messages
@headers["Content-Type"] = "application/atom+xml"
@response.headers[''Last-Modified''] =
@messages.last.created_on.httpdateunless @
messages.empty?
minTime =
2006 May 03
6
ActiveRecord and Lost Connection
This isnt totally a rails question; I am using ActiveRecord for storing
some simple values into a database. My problem; I keep gettign MySQL
Errors. On the Win32 machine it was off and on. Now on the linux
machine (ubuntu) I can'' t connect at all. I have all the password
settings correct.
My only thought, I am working with Threads and thought that might cause
the issue, but I
2006 Mar 16
3
How to paginate in descending order?
How can I paginate a set of fields in descending order based on their
created_on date?
For example, in a blog app, you want the very first entry on the first
page to be the most recent.
I see that paginate has an :order parameter, but I don''t see any way of
changing the direction of the order.
Thanks,
Jeff Coleman
--
Posted via http://www.ruby-forum.com/.
2006 Jan 05
3
ActiveRecord setting IDs on auto increment fields
Hi All, I''ve tried to do my searches, but can''t find reference to
this anywhere - My question is about ActiveRecord inserts and IDs. I
have a join table that both the models of the source tables join with
"has_and_belongs_to_many". It seems like ActiveRecord is setting the
"id" field for the join table- This should be an auto_increment and
2008 Jun 16
2
call_backs Is it?
Hi
I have the models
1.ServiceDeskTicket with fields
id --- number --- service_desk_status_id -- created_on -- updated_on
etc
2.ServiceDeskActivity with fields
id -- service_desk_ticket_id -- description -- created_on --
updated_on
3.ServiceDeskAttachment
id -- service_desk_ticket_id -- attachment -- created_on --
updated_on
Relations as
ServiceDeskticket has_many