similar to: callback object problem

Displaying 20 results from an estimated 1300 matches similar to: "callback object problem"

2007 Jan 16
1
Can't pass parameters to Ziya controller using url_for
Hi All, I''m stuck yet again. I have an action on a controller that produces a Ziya graph, which I call using the gen_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 =>
2006 Dec 27
0
HABTM Checkboxes - Adding/Updating Users to a Project
Hello all, I''m trying to create a HABTM checkbox action that adds/updates ''users'' to a ''project''. I have the following laid out. --------------------- TABLES --------------------- create_table "assignments", :id => false, :force => true do |t| t.column "project_id", :integer, :default => 0, :null => false
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
2006 Mar 13
0
Pagination attributes
I have created a pagination with my own conditions : @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 < ?
2010 Jun 08
2
type conversion with apply or not
Folks, i thought it should be straightforward but after a few hours poking around, I decided it's best to post my question on this list. 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
2006 Jul 17
1
How to DRY up validates_presence_of
Given the case of validating the presence of an attribute and then performing other tests on said attribute, how do you go about not having to check for nil in the other tests? Example: validates_presence_of :start_date, :end_date validate :validate_start_date_before_end_date def validate_start_date_before_end_date # without this check an exception will be thrown on access to the
2006 Feb 04
0
date_select
Can you see an obvious reason why this date_select code is failing? The parameters from the form - *Parameters*: {"commit"=>"Save All Changes", "campaign_id"=>"1", "campaign"=>{"name"=>"fdsfas", "end_date(3i)"=>"26", "start_date(1i)"=>"2006",
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
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:
2008 Oct 01
0
plotting several yearly/monthly time series on the same plotting several yearly/monthly time series on the same graph
I have searched the forums but I am having trouble trying accomplish two specific plots. I am not sure if this is a very basic task but I am having a lot of trouble Here is my data frame: date prod_daily price 1 2003-08-15 12050 4.83 2 2003-08-18 12050 4.94 3 2004-08-10 12300 5.78 4 2004-08-11 12300 5.64 5 2004-08-12 12300
2009 Sep 19
0
Merging API data and ActiveRecord data for display in the view...
Hi there, I’m trying to merge JSON results from an API call in with ActiveRecord results for a blended display in a view. I’d like to be able to merge the two result sets based on ''created_at'' which is is common in both the ActiveRecord results and the JSON results from the API. Created_at is the only common element between the two data sets. Here’s what I have in my controller
2013 Feb 26
4
3 models, joining and nested queries
I have 3 models, class Host ref: string address: string, name: string primary_key=''ref'' has_many :rooms, :class_name=>"Room", :foreign_key=>''host_ref'' Class Room ref :string host_ref: string capacity: integer primary_key=''ref'' has_many
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? --~--~---------~--~----~------------~-------~--~----~ You received this message
2004 Nov 08
2
Matrix Indexing
Hi, I have the following problem. In a csv file I have under column A, the date, and column 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,
2008 Jan 16
4
How to test if one range of dates overlaps another?
Hi all, I have a situation with a recurring billing application where I need to test if one range of dates "overlaps" another range of dates. Does anyone know a rails find or mysql select statement that will test for this? Here are the details: * Recurringcharge items have a start_date and an end_date that represent the period of time that the charges should occur. * Statement items
2013 Mar 25
1
validates presence of foreign key fails in nested form
I''m using accepts_nested_attributes as follows: class Timesheet < ActiveRecord::Base attr_accessible :status, :user_id, :start_date, :end_date, :activities_attributes has_many :activities, dependent: :destroy has_many :time_entries, through: :activities accepts_nested_attributes_for :activities, allow_destroy: true end class Activity < ActiveRecord::Base attr_accessible
2006 Feb 24
2
Model Inheritance?
Hello, I need some help with designing a model I have in mind. I''m not sure what the best way to do it in Ruby/Rails is, or even if what I''m thinking is possible. Basically, I have a system where I want to treat everything as a "message." A Message is a basic model object with a title and message_text. It can stand on it''s own, or it can be
2013 Mar 29
1
Create values based on a table of conditions
Hi R help forum, I have a simple data frame of four columns - one of numbers (really a categorical variable), one of dates and one of data. I have over 500,000 data points to work with, spread over 40 files, each named after a different animal. These are contact data recorded by proximity loggers over two years between the animals of the file name and collars being worn by other animals. The
2013 Mar 15
1
Reassign values based on multiple conditions
Hi all, I have a simple data frame of three columns - one of numbers (really a categorical variable), one of dates and one of data. Imagine: collar date data 1 01/01/2013 x 2 02/01/2013 y 3 04/01/2013 z 4 04/01/2013 a 5 07/01/2013 b The 'collar' is a GPS collar that's been worn by an animal for a certain amount of time, and then may have been worn by a different animal after
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