search for: start_date

Displaying 20 results from an estimated 91 matches for "start_date".

2006 Jun 21
3
Simple range question
I have a model with a datetime field called start_date. I''d like to do a find on the model so that it returns only records with the start_date equal to the current day. Something like this: @foos = Foo.find(:all, :conditions => //?? start_date equal to today''s date ??// ] ) Thanks in advance for any h...
2006 Feb 28
5
Problem with paginate, include and foreign keys
Hi all, Solaris 10 Ruby 1.8.4 Rails 1.0.0 Postgres 8.1 postgres driver 0.7.1 I''m having a problem with getting paginate() to properly pick up an FK constraint properly. I don''t seem to have this issue with ActiveRecord, however. Consider: create table start_dates ( id bigserial, start_date date unique, max_slots int default 40, primary key (id) ); create table schedules ( id bigserial, start_date_id int, ... foreign key (start_date_id) references start_dates (id), primary key (id) ); class StartDate < A...
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 create action of my vigil controller and found that @vigil.start_date.class returns Time type. I''m running Rails 1.2.3 on Ruby version 1.84.20 on a W...
2006 Feb 28
1
Working with date_select ...
...allows for the entry of year, month and date information. If I just leave it at that, great! But what if now in the controller, I want to work with the date information. I actually want to take the user input date and compute a new date some number of days in the future. How should I use "start_date(1i), start_date(2i), start_date(3i)" in a controller to fill in a new SQL date column? Does there exist helpers to convert from "start_date(1i), start_date(2i), start_date(3i)" to a Ruby Class like Date or Time? Page 203 of "Agile Web Development with Rails" implies that...
2006 Apr 15
2
Multi-parameter assignment
Hi, I''m trying to submit data from text boxes on a form to one variable in my controller, in the same way that datetime_select has date(1i), date(2i), etc for day, month, year, etc... I''ve named my variables event[start_date(1i)] event[start_date(2i)] and event[start_date(3i)] but this doesn''t seem to work and event[:start_date] is blank ... any pointers would be useful! Can''t seem to find any docs for this! Cheers, Mark -- Posted via http://www.ruby-forum.com/.
2007 Apr 09
1
help with ActiveRecord joins
...of ActiveRecord. I have an events table with quite a lot of data, with has_many relations to categories, age_groups, and event_images. In my first naive implementation, each event had a date, so to load all upcoming events efficiently, I''d do: Event.find(:all, :conditions=>[''start_date >= ?'', Date.today], :includes=[:categories, :age_groups, :event_images]) This works well, and returns all data in one query which is good, but is perhaps inefficient in that the amount of data in the events table dwarfs that in the categories, age_groups, and event_images tables. It wo...
2007 Sep 11
2
How to search with range when I am using AAF
acts_as_ferret :fields => { :name => {:}, :desc => {}, :start_date => {} } def start_date self.start_datetime.strftime("%Y%m%d") end Now that I am strong start_date in YYYYMMDD format, I want to search for all event in between 20070506 and 20070809 What will my query look like when I am using aaf. This one doesn''t work Event....
2006 Mar 28
2
Fastest way of adding " " around multiline text in RADRAILS
...ivisions where contacts.com_branch_id = 241 and employees.contact_id = contacts.CONTACT_ID and contacts.expired=0 and timesheets.id = items.timesheet and activities.id = items.activity and employees.id=timesheets.employee and divisions.id=employees.division and timesheets.status = 3 and timesheets.start_date >= ? and timesheets.start_date < ? group by timesheets.employee Thanks, Chris -- Posted via http://www.ruby-forum.com/.
2013 Mar 30
1
How to use group in nested associations
The below query fails: Timesheet.joins(:time_entries).select("timesheets.*, sum(time_entries.worktime) as total").group("timesheets.start_date") The models have the following relations: Timesheet < AR has_many :activities, dependent: :destroy, inverse_of: :timesheet has_many :time_entries, through: :activities accepts_nested_attributes_for :activities, allow_destroy: true end class Activity < AR belongs_to :timesheet...
2011 Apr 20
3
[test message] Can R replicate this data manipulation in SAS?
...iods of time and decides whether that constitutes HAART or not. To me, this is a pretty tricky data manipulation in SAS. Is there any way to get the equivalent result in R? Thanks, Paul **** SAS syntax for coding HAART in HIV patients; **** Read in test data; data haart; input id book_class $ start_date :mmddyy. stop_date :mmddyy.; format start_date stop_date mmddyy8.; cards; 1004 NRTI 07/24/95 01/05/99 1004 NRTI 11/20/95 12/10/95 1004 NRTI 01/10/96 01/05/99 1004 PI 05/09/96 11/16/97 1004 NRTI 06/01/96 02/01/97 1004 NRTI 07/01/96 03/01/97 9999 PI 01/02/03 . 9999 NNRTI 04/05/06 07/08/09...
2013 Jan 29
2
Count entries in postgresql grouped by date
...ts 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: start_date..end_date) visits = visits.group("date(visited_at)") visits = visits.select("date(visited_at) as date, count(visits.id) as total_visits") visits = visits.order("date ASC") visits.group_by { |v| v.dat...
2010 Jun 08
2
type conversion with apply or not
...ist. I have a data frame consisting of a (large) number of date columns, which are read in from a csv file as character string. I want to convert them to Date type. Following is an example, where the first column is of integer type, while the rest are type character. > head(df) TRANSNO TRANS.START_DATE TRANS.END_DATE DIVISION FASB 1 250897 7/1/2010 7/31/2010 PSTRUCT Z 2 250617 8/1/2010 8/31/2010 PSTRUCT Z 3 250364 4/1/2011 6/30/2011 PLR Z 4 250176 4/1/2011 6/30/2011 PLR Z 5 250176 4/1/2011 6/30/2011...
2007 Jun 19
5
Problems translating should_render from 0.8.2 to 1.0.5
...to figure out which file is being rendered instead), but the big problem is that when testing actions that render a partial (mostly for ajax calls) we need to test the locals that get passed into the template.<br><br>here''s a typical spec:<br>&nbsp; specify "the :start_date should equal the date passed in" do<br>&nbsp;&nbsp;&nbsp; @mock_event_calendar_data = mock(''Mock event_calendar_data'')<br>&nbsp;&nbsp;&nbsp; EventCalendarData.should_receive(:new).and_return(@mock_event_calendar_data)<br>&nbsp;&am...
2008 Jun 24
10
Question on passing arguments inside a view.
I''m running into an issue undefined local variable or method `directoryid'' for #<EditorialsController:0x23f1bf8> I have two Models on a legacy database and only one controller called editorials with two actions index and display. I''m trying to pass in a parameter from the results of my search and getting the above error. Example: two tables one is editorial the
2004 Nov 08
2
Matrix Indexing
...B, the prices. Thus, for example, the file looks something like this -> 1/31/04 2.5 2/1/04 2.6 ... 4/12/04 3.5 Basically, I use the function inputframe = read.csv( ) which reads the csv file into the inputframe. My question is, how can I make a function that has, as inputs, start_date and end_date, so that the inputframe would not return all of these prices but only the ones during the period I input? For example, if I input 3/1/04 and 3/11/04, the inputframe only contains the prices for this period. Any help is appreciated!! Kim
2012 Oct 12
1
Adding Time when Blanks
...know if there is anything else you need. Thanks for your time. I have Start_of_Experiment in POSIX format for time calculations from the following: data$Start_of_Experiment=as.POSIXct(strptime(data$start_time, "%m/%d/%Y %H:%M:%S")) Here is a subset of my data. ID group Start_date Time_of_experiment Time_of_end 1 20209 4 02/02/2009 12:38:00 26 30209 3 03/02/2009 12:40:00 13:32:00 27 31609 4 03/16/2009 11:28:00 12:26:00 28 40609 4 04/06/2009 11:17:00 53 42709 4 04/2...
2006 Mar 13
0
Pagination attributes
...onditions : @timesheets_pages = Paginator.new self, count, 30, @params[''page''] @timesheets = Timesheet.find :all,:include =>{:employee=>[:location,:division]}, :conditions => ["employees.location=? and employees.division=? and start_date>? and end_date < ? ",@location.id,@division.id,@start_date,@end_date], :order=> "timesheets.start_date desc", :limit => @timesheets_pages.items_per_page, :offset => @...
2008 Nov 11
1
Every other week recurring event
I have the code for computing a weekly event: (start_date..end_date).select{|d| d.wday == wday} but I am wondering if anyone has any ideas for using this to figure out a recurring event for every other week. Is it possible to somehow specify every other within the .select method? Any other implementation ideas? --~--~---------~--~----~------------~----...
2007 Jan 16
1
Can't pass parameters to Ziya controller using url_for
..._chart() helper. However, I can''t seem to pass more than one parameter through to the action. <%= gen_chart( "overview_graph", url_for( :controller => ''graph'', :action => ''graph'', :graph_id => GraphController::GRAPH_OVERVIEW, :start_date => @report_params[:budget_period][:start_date].to_f, :end_date => @report_params[:budget_period][:end_date].to_f, :size => 300 ), "#ffffff", 300, 300 ) %> This just doesn''t work, however. The start date is passed through to the underlying action, but the...
2009 Jan 27
1
Creating list or numeric vectors out of selected columns of row oriented data
...ngle subject. I would like to transform the data so that I have an R object with a single entry for each subject and start date and vectors for the observation dates and the observations. The data are something like the following where for each subject the subject_id does not change and the start_date does not change, but the obeservation_date and the three different observations change between rows. (There is one row for each day for each subject over a three year period although some entered the study late): 'subject_id', 'start_date','observation_date','wei...