Displaying 20 results from an estimated 2000 matches similar to: "Active record question"
2009 Nov 01
1
please help - complicated polymorphic association
I am trying to build a shared-appointment system, where users can
subscribe to appointments and be updated whenever changes are made to
them. I have three objects in this system, appointments, users, and
subscribers. Subscribers are a polymorphic object like so:
class Subscriber < ActiveRecord::Base
belongs_to :user
belongs_to :subscribable, :polymorphic => true
end
The tricky part is
2006 Mar 29
3
Redirect Post for Hiding ID?
I have a situation where I want to show the user details about an
appointment they entered. They enter their name, phone number(s) and
other private data in a form. I save that data in the controller with
a POST from a "confirmation" page.
I could simply show the params when that page is rendered (the save
one), but if they use the browser refresh it''ll save the data again.
2007 Oct 07
22
Differences in execution between console and app
class AppointmentBook < ActiveRecord::Base
has_many :appointments
def lookup(date, look_ahead = 27)
return nil unless block_given?
(date..date + look_ahead).each do |date|
yield(date, appointments.find_all_by_date(date))
end
end
end
The line with yield is throwing the error:
undefined method ''each'' for #<Date: 4908761/2,0,2299161>
A YAML
2013 Apr 26
2
looking for a way to do appointment reminders
Hello,
My health care organization is looking for a way to do appointment
reminders. We currently have staff members who spend part of each day
manually calling patients to remind them of their upcoming appointments,
and we would like to automate this process.
Our electronic health record software would provide such information as
the patient's name, phone number, and day and time of
2008 Oct 28
3
Dose Profile
Hi Everyone,
I have data in a long format e.g. there is one row per patient but each
follow-up appointment is included in the row. So, a snippet of the data
looks like this:
TrialNo Drug Sex Rand Adate1 Date1 Dose1 Time1 Adate2 Date2 Dose2
Time2 B1001029 LTG M 15719 30/04/2003 15825 150 106 29/08/2003 15946 200
227 B1117003 LTG M 15734 30/04/2003 15825 200 91 03/09/2003 15951 250 217
2005 Oct 19
4
ER strikes back
Hi Railers,
A long, long, time ago, i made a Framework/CMS in php.
There were two core models: Content and Content_type.
Content_type was only a list of content types (as expected): new, article, etc.
Content_type was not mandatory, but it allowed later to "deactivate"
types of contents, for example.
So then Content stored the common attributes/properties between the
different content
2011 Dec 10
1
ActiveRecord time and datetime
Hi,
Suppose I have a model class which has a time field:
class CreateAppointments < ActiveRecord::Migration
def change
create_table :appointments do |t|
t.string :name
t.datetime :startTime
t.datetime :endTime
t.string :description
t.timestamps
end
end
end
When I test drive it in rails console, I can input any value int he
startTime and endTime such
2008 Sep 02
5
Appending a record to a table
Hi
I''m not too sure how best to explain this but here goes!
I am trying to write an appointment system. I have, through example,
just about got the dynamics correct. Even tried to play with some
table joins (and excuse me if I''ve used the incorrect terminlogy). But
no matter what I try I can''t seem to get the following code to work.
I have a cart filled with Treatment
2006 Jul 16
4
Calculations across multiple tables
I have a time tracking app where (pseudo-code)
Client has_many Task has_many TimeRecord
TimeRecord
start_at, :datetime
end_at, :datetime
What I''m trying to do (and I have done using find_by_sql in the past) is get
a sum of the timespan given by ended_at - begun_at for each client.
Is it naive to imagine that AR''s calculations will span relations to provide
a grouped
2007 Aug 14
12
ruby on rails web calendar
Does anyone know of a good web calendar that you can use to display
appointments, dates, anniversaries, birthdays, recurring appointments,
appointments spanning multiple days?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2012 Oct 23
10
How to pick colums from a ragged array?
I have a large dataset (~1 million rows) of three variables: ID (patient's name), DATE (of appointment) and DIAGNOSIS (given on that date).
Patients may have been assigned more than one diagnosis at any one appointment - leading to two rows, same ID and DATE but different DIAGNOSIS.
The diagnoses may change between appointments.
I want to subset the data in two ways:
- define groups
2006 Jul 27
1
Update second pulldown menu based on first menu selection?
I know I''ve seen this somewhere on this board and just can''t search it
anymore.
I have three relational tables: clients, projects, and tasks. Currently
I''m working on customizing the ''new/edit'' task _form. So far I have it
listing clients in a pulldown menu so I can assign the new task to a
client. I''d like to have a second pulldown select
2018 Jul 25
1
Which is better? Microsoft Exchange 2016 or Linux-based SMTP Servers?
> [...] People want their phone to
> remind them of their appointments [...]
It's a generalization. Not valid for all people.
Maybe SOME people want their phone to remind them of their appointsments.
My appointments are synchronized from owncloud to Thunderbird and to
many (LineageOS-based) smartphones and tablets and >>I<< do NOT want to
be reminded on the smartphones
2005 Aug 11
3
is this possible with asterisk?
Hello Everyone!
I'm wondering if the following is possible with asterisk...
What i'm trying to do is find a program or a solution that can help me set
appointments for a delivery company...
the program should call a person asking them if the following time is suitable
for a delivery... if they agree, they press one and the system logs it... if
they don't agree they press two, etc...
2011 Oct 16
2
question: ragged array
Hello,
I have a big problem which I’m just not able to solve.
I created the following mean value from the following dataset structure:
Id |value
1 | 2
1 | 3
1 | 4
2 | 2
2 | 1
3 | 5
4 | 3
etc.|etc.
with the command:
mean_rating <- tapply(ratok$value, ratok$project_id , mean,simplify = FALSE)
this gives me a ragged array:
> mean_rating [1]
$`14`
2008 Jun 13
2
Rails 2.1.0 - find with :include and missing JOIN in SQL query
Hi,
We''re trying to rewrite veeeery old Rails app that we successfully
managed to move to 1.2.6 and now we''re trying with 2.1.0.
One of the problems is caused by :include in AR.find. Rails 1.2.6
generates totally different SQL query than
2.1.0. Here''s Rails find query and generated SQL queries:
Foo.find(:all, :include => :ticket, :conditions =>
2007 Jul 22
2
Seek brilliant Rails programmer to add one field to acts_as_taggable
I''m on the downhill side of a large project that requires an
additional integer field to be added to the tag.rb in
acts_as_taggable. I feel I have a good understanding of ActiveRecord
and have performed the correct migrations.
(As a short background for those following this thread) when one wants
to add tags to a model they call the ''tag_with'' method that jumps into
2008 Aug 26
4
syncml with server push email
Any recommendations for server push email using syncml and dovecot?
I am familiar with Funambol for syncing pim info, but not used it for email.
Are there any recommended opensource or commercial syncml servers that are
known to integrate nicely with Dovecot 1.x? Googling hasn't really turned up
much in the way of useful info.
To mix it up a little, I was using Funambol for the Pim
2010 Jul 15
3
Good script to make appointment?
Hello
I'd like to write a script that would make it easier for people to
call in, listen to the IVR, and make an appointment (eg. "When? ASAP?
A given day?" -> "Morning? Afternon", etc.)
I assume I'm not the first one to try and write this type of IVR, so
would appreciate any feedback on writing this.
Thank you.
2006 Jun 01
4
can''t convert Fixnum into String ??
I have been getting this error message on various pages, just wondering
if anyone could explain whats going wrong, and the best way to correct
it
code that is cuasing the problem is below
@project = Project.find(:first, :conditions => "id = " +
@purchaseorder.project_id)
--
Posted via http://www.ruby-forum.com/.