Displaying 6 results from an estimated 6 matches for "read_at".
2012 Apr 17
1
simple time series plot
I'm an absolute R newbie, but my question is (or at least seems) simple:
I have a number of sensor values from different sensors, along with
timestamps, so something like this:
sensor 1:
read_at: 1 2 4 5 6
value: 1 15 8 15 23
sensor 2:
read_at: 2 3 4 6 7
value: 10 11 7 12 28
what I need is a line plot of the sensor values, aligned given their
timestamps (it's in unix epoc time).
which data structure should i use? ca...
2005 Dec 19
4
need some help designing my messaging system
I am trying to create a messaging system for my users but I''m having a
hard time designing my db. This is what i have in mind, but I am not
sure if its the best approach.
user has_one inbox
user has_one outbox
inbox has_many messages
outbox has_many messages
inbox table
user_id
outbox table
user_id
messages table
box_id (refers to either inbox or outbox - how?)
from_id
to_id
2006 Jan 02
2
ActiveRecord:
...ion) there is an
example of (within ActiveRecord) marking an article as read by a user at
the present time. Short example code (from the book) here:
class User < ActiveRecord::Base
has_and_belongs_to_many :articles
def read_article(article)
articles.push_with_attributes(article, :read_at => Time.now)
end
# ...
end
However, it seems this piece of code would only work the first time you
read a specific article. It appears to always create a new join table
post, and not to just update if there is an existing post. How would one
best solve this?
--
Posted via http://w...
2006 Jan 02
1
ActiveRecord, << or push_with_attributes: update if exists?
...ion) there is an
example of (within ActiveRecord) marking an article as read by a user at
the present time. Short example code (from the book) here:
class User < ActiveRecord::Base
has_and_belongs_to_many :articles
def read_article(article)
articles.push_with_attributes(article, :read_at => Time.now)
end
# ...
end
However, it seems this piece of code would only work the first time you
read a specific article. It appears to always create a new join table
post, and not to just update if there is an existing post. How would one
best solve this?
--
Posted via http://w...
2006 Apr 29
5
HABTM - how to insert join row when associated rows exist
...of
rows in one step. Now, if two objects I want to associate already exist,
how do I create the join row? The Agile book mentions the
''push_with_attributes'' method. The text says this method is useful for
adding additional attributes to the join row (in the example a ''read_at''
timestamp). I only require a simple two-key join row - is
''push_with_attributes'' the way to go?
-Lindsay
--
Posted via http://www.ruby-forum.com/.
2006 Feb 21
7
Self-referencial habtm relationship
Heyo!
I am setting up a self-referencial habtm relationship with the users
of my app. I am using Chad Fowler''s "Rails Recipes" to get me started,
and everything works great with the join table "people_friends". I add
friends by doing somebody.friends << somebodyelse. However, with my
app, there is an approval process so my join table has columns
person_id,