similar to: Date format in Rails 3.0 using sqlite3

Displaying 20 results from an estimated 6000 matches similar to: "Date format in Rails 3.0 using sqlite3"

2006 Dec 11
1
Compute date during before_validation_on_create
Hello, - the form posted by the user have a date field - this date is begin_date, I need to compute end_date - so, added callback before_validation_on_create - in this method I do : end_date = begin_date >> 12 - unfortunately, beeing in before_validation the actual self.begin_date have not been type casted - It''s always a string - unfortunately again, I can''t put this code
2012 Jul 10
1
calculating the difference between days?
Hi List, I have one column of beginning dates and one column of ending dates, I want to find their difference. And I want to ignore the trailing zeros, basically everything after the first colon mark. Begin_date End_date 01JAN2000:00:00:00:000 02FEB2002:00:00:00:000 24MAR2012:00:00:00:000 18MAY2012:00:00:00:000 01OCT2003:00:00:00:000
2006 Apr 18
3
ez_where query question
I''m having fun composing queries with ez_where, but am stuck on how to formulate the following using the ez syntax: (begin_date >= ? OR end_date >= ?) AND (description LIKE ? OR name LIKE ?) There are two clauses, each containing OR operators (the ez ''any'' syntax) but both clauses must evaulate to true for a match. Can anyone suggest the proper way to construct
2006 Feb 28
6
Activerecord equivalent of the SQL "SUM()" function.
Search doesn''t seem to be working, so forgive me if I''m covering old ground here, but I''m having a difficult time figuring out how to implement a "SUM()" function using Active record. Obviously, I could just create a query, but I''d rather make it part of my active record object. Basically I have an object called "Report <
2008 Oct 14
4
replace_html not working
hallo, everyone can anybody help me? i did add my code under ENGINES as a module in a project. before the change , all worked . and the differenz between both is only about application''s environment, before is Ruby version 1.8.6 (i486-linux) RubyGems version 1.1.1 Rails version 2.0.2 Active Record version 2.0.2 Action Pack version 2.0.2
2006 Jan 16
1
Bundled resource -- something I''m missing
I have a decoupled form embedded in my pages ? a search box that has date fields ? and of course the search fields are not in my model. However, picking dates is a great use for the Dynarch calendar. It seems that by using the syntax: <%= render :partial => ?filter_box? %> In my view and... <%= dynarch_date_select ''filter_box'', ''begin_date'' %>
2007 Jun 25
0
[1073] trunk/wxruby2/doc/textile/calendarevent.txtl: Explain that get/set_week_day work with Integers
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding:
2006 Jan 17
4
find_by_sql column ordering defect?
Hello. I have a program that accesses a metadata (translation) table for column names as well as the ordering of columns for a specific model. Also in there is a collection of bool options such as column_visible_on_form, column_visible_on_screen_quicklist etc. The idea is that our customer can specify to a certain extent how their layout/user interface will appear. To accomplish this, I use
2006 Jun 25
1
Sorting ferret results by column
I have the acts_as_ferret plugin installed. Everything searches great, but I would like to limit the results (i.e. by ''end_date'') and sort them (by ''end_date''). ''end_date'' is a valid column in my "posts" table. Here''s the code I have already: @posts = Post.find_by_contents(params[:query]) params[:query] comes from a form. I
2013 Jan 29
2
Count entries in postgresql grouped by date
Hi! I have a table with visits with a visited_at: attribute which is a datetime field. They seem to be stored as UTC. Now I want to count all visits each day and return something like: { 2013-01-01: 8, 2013-01-02: 4, 2013-01-07: 9, ... } So, I did it like this which kind of works...: def self.total_grouped_by_day(start_date, end_date) visits = where(visited_at:
2006 Jun 14
4
Using now() to determine what should be displayed
I''m trying to create a paginated list that will take note of the "end_date" field in my table. This is what I have: @post_pages, @posts = paginate(:posts, :per_page => 10, :order_by => ''end_date'') in the controller. And for the view: <h1>Posts ending soon</h1> <ul><% for post in @posts do %> <strong>Post Title:
2007 Jun 25
0
[1067] trunk/wxruby2: Set up event handlers in Ruby rather than by post-processing SWIG output
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding:
2008 Nov 12
1
gem ruby-sqlite3 install error
i am tryin' to install ruby-sqlite3 via gem, but it keeps givin' me this output: mathilda ~ # gem install sqlite3-ruby Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb install sqlite3-ruby checking for fdatasync() in -lrt... no checking for sqlite3.h... no make make: *** No
2006 Jun 15
1
callback object problem
I''m trying to create a separate class to do validation so that about 10 models can use the same date validation. I have tried to use the example from the agile book but it''s not working. Here''s what I have: app/models/date_callbacks.rb class DateCallbacks def before_validation(model) if model.start_date > Date.today model.errors.add(:start_date, "must
2006 Jun 25
3
Sorting results by column
I have the acts_as_ferret plugin installed. Everything searches great, but I would like to limit the results (i.e. by ''end_date'') and sort them (by ''end_date''). ''end_date'' is a valid column in my "posts" table. Here''s the code I have already: @posts = Post.find_by_contents(params[:query]) params[:query] comes from a
2009 Apr 21
2
problem with sqlite3....
Hi all, I am relatively new to ruby and RoR. I created a simple rails proj named foo by giving command -> rails foo --database=sqlite3 It created a new rails proj.. So in that I created a simple db class named user by using the below command -> ruby script/generate model user so in db/migrate I got a file named 20090421211825_create_users.rb created. and in app/models : user.rb got
2007 Apr 13
0
[961] branches/wxruby2/wxwidgets_282/swig: Move wxDateTime typemap into shared file, map to core Time class instead
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding:
2008 Mar 24
0
[LLVMdev] Adding SQLite3 to llvm test-suite
Hi Edwin, It works fine for me. Thanks! We prefer a flat directory structure. Is it possible for you to separate it out to sqlite3 and lemon rather than having them as sub- directories under SQLite? Also, can you increase lemon's test size? Please file bug about the performance issue. Thanks! Evan On Mar 22, 2008, at 8:20 AM, Török Edwin wrote: > Hi, > > SQLite3 has a very
2012 Feb 27
0
Rails 3.1 and SQLite3
I am getting this message when running my tests against RoR-3.1 .rvm/gems/ruby-1.8.7-p352/gems/activerecord-3.1.1/lib/active_record/ connection_adapters/abstract/connection_specification.rb:71:in `establish_connection'': Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (sqlite3 is not part of the bundle. Add it to Gemfile.) However, I already have this in my
2010 Aug 10
3
[LLVMdev] sqlite3 crashing jit
Hello, I'm trying to compile sqlite3 using llvm-gcc, then run it with lli. I've attached a Makefile and a main.c that simply invokes sqlite3_initialize(). You'll need to download sqlite3 (it was too big to attach) and copy main.c and the Makefile into the directory where sqlite3.c is [Link: sqlite-amalgamation-3_7_0_1.zip <http://www.sqlite.org/sqlite-amalgamation-3_7_0_1.zip>