Displaying 20 results from an estimated 418 matches for "updated_at".
2006 Jul 11
8
Stop updated_at from auto updating?
Hi
Is there any way to temporarily stop the updated_at field from being
updated when a record is modified with ActiveRecord?
I have a date field which is keeping track of when the record data was
last checked by my application and my app manually updates it, of course
when I do this the updated_at field is also touched making it fairly
useless for...
2012 Oct 23
7
Not updating the updated_at field
...l be updated
when the something about the record is seen in the real world (don''t
worry about this part)
So I go x.update_attribute(:last_seen, Time.now) and the following happens is
UPDATE "blah" SET "last_seen" = ''2012-10-23 08:57:46.179288'',
"updated_at" = ''2012-10-23 08:57:54.872808'' WHERE "blah"."id" = 2673
Now, just for this one attribute, I would like the updated_at field to
be unmolested. Is there some way of updating the last_seen field
without ActiveRecord updating the updated_at field?
--
You r...
2008 Feb 12
4
Syntax of session's updated_at field ?
What''s the syntax to acquire the updated_at value of a session stored
in a db?
session.updated_at doesn''t work. can''t find any docs on this.
-- gw
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To po...
2010 Jul 20
4
MySQL index question
...ng to speed up some DB operations and perhaps have gone overboard
with indexes. Does MySQL usually use only one index per query and simply
match keys on the results of the indexed first part? For example:
DELETE FROM tokens WHERE 6813946236211560448 <= fnv AND fnv < 6818449835838930944 AND updated_at<''2010-06-20 14:08:55'' AND occurrences=0;
If I understand correctly from the output of:
EXPLAIN SELECT * FROM tokens WHERE 6813946236211560448 <= fnv AND fnv < 6818449835838930944 AND updated_at<''2010-06-20 14:08:55'' AND occurrences=0;
only the inde...
2011 Oct 11
10
Create Two objects at the same time
I have user model and referral model. Referral model has user_id as
field.
Now when a new user is created, I need to call referral#create as well
and pass it the id of the newly generated user to user_id of referral
model. How can I do that.
--
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
2010 Jul 08
3
Testing equality
Hello
How can I test equality with two objects when they include some
attribute that is BigDecimal?
if I make something like this:
it "should ...whatever" do
obj = Factory.create(:my_object)
...
MyObject.first.should == obj
end.
FAILS
This fails because the object expected is different from the object
gotten, and the only difference are the BigDecimal attributes, that are
2010 May 11
1
has_one/belongs_to -- accessing the subordinate
...ivate
def create_carriage
Carriage.create(:horse => self)
end
end
class Carriage < ActiveRecord::Base
belongs_to :horse
end
============
This works fine using create:
========
>> horse1 = Horse.create()
=> #<Horse id: 5, created_at: "2010-05-11 16:17:06", updated_at:
"2010-05-11 16:17:06">
>> horse1.carriage
=> #<Carriage id: 5, created_at: "2010-05-11 16:17:06", updated_at:
"2010-05-11 16:17:06", horse_id: 5>
========
It also works if you call Horse.new(), horse.save!() and *then*
horse.carriage():
========
>...
2013 Sep 11
1
when does 'updated_at' column get updated?
Using centos 6 with puppet-2.6.17 with thin_storeconfigs with mysql and
nagios exported resources. Every time an agent connects to the master, the
updated_at column in the hosts table is updated. However, the updated_at
column in the other tables is not updated even when I alter a nagios
resource attribute like retry_check_interval. What are the conditions by
which the updated_at column is updated for the other tables?
--
You received this message...
2006 May 17
0
acts_as_versioned with lock_version bug?
...quot;Changed name"
=> "Changed name"
>> s.version
=> 2
>> s.save
=> true
>> s.version
=> 3
>> s.versions
=> [#<Software::Version:0xb7a8d290 @attributes={"name"=>"Initial
name", "updated_at"=>"2006-05-16 21:25:28", "software_id"=>"1",
"id"=>"1", "version"=>"1"}>, #<Software::Version:0xb7a8d240
@attributes={"name"=>"Initial name", "updated_at"=>"2006-0...
2011 Apr 27
2
Can not create model instance via params on specific model but can on others....
...re is no logic in
it. Ruby 1.8.7/Rails 3.0.5.
Does not work:
(rdb:1) PaymentTransaction.create(:purchase_id => 3)
#<PaymentTransaction id: 2, purchase_id: nil, action: nil, amount: nil,
success: nil, authorization: nil, message: nil, params: nil, created_at:
"2011-04-27 18:18:59", updated_at: "2011-04-27 18:18:59">
But this works (but is ugly):
(rdb:1) bpt = PaymentTransaction.new
#<PaymentTransaction id: nil, purchase_id: nil, action: nil, amount: nil,
success: nil, authorization: nil, message: nil, params: nil, created_at:
nil, updated_at: nil>
(rdb:1) bpt.purcha...
2008 Jul 02
3
update_all not changing updated_at
Hi everyone-
Model.update_all works and changes the records, but it''s not changing
the updated_at field. Am I doing something wrong or is this by
design?
Thanks,
Dino
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA3...
2011 Oct 02
4
Aggregated attribute changed but _was is changed too. So nothing is update in database.
...:001 > @hunting = Hunting.find(1)
Hunting Load (7.6ms) SELECT "huntings".* FROM "huntings" WHERE
"huntings"."id" = $1 LIMIT 1 [["id", 1]]
=> #<Hunting id: 1, path: "((7,6),(5,4))", created_at: "2011-10-02
16:02:11", updated_at: "2011-10-02 18:08:45">
ruby-1.9.3-rc1 :006 > @hunting.path
=> #<Path:0xaabba1c @points=[#<Point:0xaabb968 @x=7, @y=6>, #<Point:
0xaabb8c8 @x=5, @y=4>]>
ruby-1.9.3-rc1 :002 > @hunting.one_step_forward!
=> #<Point:0xaebc058 @x=7, @y=6>
ruby-1.9.3...
2009 Oct 16
5
Rails 2.3 Model.touch(:column) always also updates :updated_at???
Hi,
Am I the only one (i.e. something I do is wrong), or does the touch-
method always update updated_at, even though giving it a column to use
INSTEAD is meant to update just that column???
Thanks,
Michael
2008 Jan 12
1
Collection_Select not showing Selected option
...###
The controller;
###
def driver_edit
@drivers = CallDriver.find(params[:id])
@productline = ProductLine.find(:all)
end
###
And the debug results for CallDriver
--- &id001 !ruby/object:CallDriver
attributes:
name: Billing (TV)
segment_id: "1"
platform_id: "1"
updated_at:
product_line_id: "3"
id: "2"
sub_product_line_id: "7"
consolidation_id: "1"
skill_id: "1"
created_at: 2008-01-10 20:04:04
attributes_cache: {}
Debug results for ProductLine;
- !ruby/object:ProductLine
attributes:
name: RHP
u...
2011 Nov 02
4
undefined method `updated_at' for #<Classified:0x686c5e4>
HEllo, I have the following problem with rails, I am new in this...is
there anyone who explain to me what´s happens?
Thanks
See below:
NoMethodError in Classified#show
Showing app/views/classified/show.rhtml where line #17 raised:
undefined method `updated_at'' for #<Classified:0x686c5e4>
Extracted source (around line #17):
14:
15: <strong>Date Posted:</strong> <%=
distance_of_time_in_words_to_now(@classified.created_at) %> ago <br />
16:
17: <strong>Last updated:</strong> <%=
distance_of_ti...
2006 Jan 10
5
Select Tag and Associations
...ng". That part I ''believe'' is correct, however I very well could
be off on that.
The columns in the postings table:
+-------------------
| Field
+------------------
| id
| title
| body
| user_id
| category_id
| posting_status_id
| posting_image_id
| comment_id
| created_at
| updated_at
+-------------------
The columns in the categories table:
+-------------
| Field
+-------------
| id
| title
| description
+-------------
With the following code I can successfully display the categories in
the drop down, but the ID is not saved to the postings table.
<%= select("categor...
2006 Mar 24
1
Multiple table relationships
Hello,
I''m just starting out with some Rails development and have the following
table structure. I understand how to do a two table has many join but I
actually need to relate a third table. Here is my structure:
components
id
name
updated_at
elements
id
name
updated_at
element_types
id
name
updated_at
components_elements
component_id
element_id
element_type_id
updated_at
My Component model has the following:
class Component < ActiveRecord::Base
has_and_belongs_to_many :elements
end
I haven''t actu...
2009 Apr 29
1
Different behaviour on ActiveResorce with JSON or XML
I''m doing a request from a Rails app to another Rails app with
ActiveResource.
When the format on ActiveResource is XML:
Content.find(:all)[0,2].map(&:attributes)
=> [
{"updated_at"=>Mon Apr 27 15:04:32 UTC 2009,
"url"=>"www.google.com", "id"=>1, "created_at"=>Mon Apr 27 15:04:32
UTC 2009},
{"updated_at"=>Tue Apr 28 14:48:55 UTC 2009,
"url"=>"www.google.com", "id"=>2, &...
2008 Oct 06
1
Rails console, saving objects
I was reading a book and following the instructions in it.
>> class Story < ActiveRecord::Base; end
=> nil
>> story = Story.new
=> #<Story id: nil, name: nil, url: nil, created_at: nil,
updated_at: nil>
>> story.class
=> Story(id: integer, name: string, link: string,
created_at: datetime, updated_at: datetime)
I do not remember me asking for id, name, link or url, created_at and
updated_at. I do know if I typed craeted_at instead of created_at or
updetad_at instead of updated_at...
2009 Apr 15
2
Getting Started with Rails - post_comment_url
...ll where is this defined.
Below is the message I am getting.
Thanks
ActionController::RoutingError (post_comment_url failed to generate
from {:post_id=>#<Post id: 1, name: "lin", title: "post 1", content:
"content 1", created_at: "2009-04-15 16:56:44", updated_at:
"2009-04-15 16:56:44">, :action=>"show", :id=>#<Comment id: nil,
commenter: "jake lin", body: "this is a new comment", post_id: 1,
created_at: nil, updated_at: nil>, :controller=>"comments"}, expected:
{:action=>"show"...