similar to: update_all for an AR instance

Displaying 20 results from an estimated 2000 matches similar to: "update_all for an AR instance"

2006 Jun 01
2
update_all broken in postgres?
Hi has anyone managed to use update_all with rails on postgres? In my setup, it does not work: >> @keyword.update_all(myupdates) NoMethodError: undefined method `update_all'' for #<Keyword:0xb7ac4670> from /home/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/base.rb:1786:in `method_missing'' from (irb):14 I checked that the base.rb
2010 Jul 14
1
ActiveRecord::Observer, update_all and has_many
Hi, I''m using an ActiveRecord::Observer to log users changing data in my application. However, I''ve noted that adding an item to a has_many relationship gets logged, but removing the item does not. That is: @product.users << user is logged, but: @product.users.delete(user) is not. I''ve dug into ActiveRecord and found that the underlying issue is that the
2006 May 31
1
Help enhancing acts_as_nested_set
I''m trying to enhance acts_as_nested_set. Well actually I already have, but I''ve done a hack up job of it. I would like to contribute these enhancements back, but I need a little help. I''m a complete newbie to this stuff. The only thing I new before coming into this project was vanilla HTML. So over the course of two weeks I''ve picked up Ruby, Rails, MySQL,
2006 Jul 06
4
update_all Not Incrementing lock_version
Shouldn''t update_all be updating lock_version? As you can see from my console session below, it is upating the record (changed running attribute to true and returned 1 to show 1 recored was updated). But it did not increment lock_version. And optimistic locking is working correctly otherwise. As you can see below, lock version = 562 before and after the update_all call but it is
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed. CHANGES ------- Revision 8649 committed by gbuesing on 2008-01-16 20:07:10 Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002 M /trunk/activesupport/CHANGELOG M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb M /trunk/activesupport/test/core_ext/date_time_ext_test.rb TEST FAILURES AND
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
2005 Nov 30
0
Passing variables with update_all
I''d like to produce an SQL update along the lines of: UPDATE companies SET category2={newcategory} WHERE (category2 = {oldcategory}) At the moment I''ve got: ctype = params[:ctype] Company.update_all("category2=ctype", "category2=ctype") At present this returns a StatementInvalid: Unknown column ''ctype'' in ''where clause'':
2007 Sep 07
6
ActiveRecord::Base#update_all expected behaviour
Hi I noticed that if in my code I use the following: Photo.update_all("title = ''Ruby rocks'' ", "id IN (#{@photo_ids})") All my objects are properly updated but none of the filters/callbacks are triggered. Is that what''s expected? I have a before_update filter set on the Photo class and it gets totally ignored, I guess the only way to solve this
2010 Dec 07
0
[PATCH]: A daemon to support HyperV KVP functionality
From: K. Y. Srinivasan <ksrinivasan at novell.com> Subject: An implementation of key/value pair feature (KVP) for Linux on HyperV. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> Index: linux.trees.git/drivers/staging/hv/tools/hv_kvp_daemon.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++
2010 Dec 07
0
[PATCH]: A daemon to support HyperV KVP functionality
From: K. Y. Srinivasan <ksrinivasan at novell.com> Subject: An implementation of key/value pair feature (KVP) for Linux on HyperV. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> Index: linux.trees.git/drivers/staging/hv/tools/hv_kvp_daemon.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++
2010 Dec 08
0
No subject
This daemon gathers all the guest specific information needed to support = the HyperV KVP functionality. This daemon communicates with the kernel component via a netlink channel. Signed-off-by: ksrinivasan <ksrinivasan at novell.com> --- drivers/staging/hv/tools/hv_kvp_daemon.c | 470 ++++++++++++++++++++++++++= ++++ 1 files changed, 470 insertions(+), 0 deletions(-) create mode 100644
2010 Dec 08
0
No subject
This daemon gathers all the guest specific information needed to support = the HyperV KVP functionality. This daemon communicates with the kernel component via a netlink channel. Signed-off-by: ksrinivasan <ksrinivasan at novell.com> --- drivers/staging/hv/tools/hv_kvp_daemon.c | 470 ++++++++++++++++++++++++++= ++++ 1 files changed, 470 insertions(+), 0 deletions(-) create mode 100644
2010 Dec 17
0
[PATCH 4/4] Staging: hv: Add a user-space daemon to support key/value pair (KVP)
All guest specific data gathering is implemented in a user-mode daemon. The kernel component of KVP passes the "key" to this daemon and the daemon is responsible for passing back the corresponding value. This daemon communicates with the kernel component via a netlink channel. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> --- drivers/staging/hv/tools/hv_kvp_daemon.c
2010 Dec 17
0
[PATCH 4/4] Staging: hv: Add a user-space daemon to support key/value pair (KVP)
All guest specific data gathering is implemented in a user-mode daemon. The kernel component of KVP passes the "key" to this daemon and the daemon is responsible for passing back the corresponding value. This daemon communicates with the kernel component via a netlink channel. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> --- drivers/staging/hv/tools/hv_kvp_daemon.c
2007 May 16
7
return ONLY total_hits without querying from real database
Hey guys, I know I can run search(q).total_hits, but if I try to put :limit=>0 it gives me an error. I don''t want it actually query any of the results, I just want it to tell me how many total_hits I would have if I wanted to search it. How can I do this? -- Posted via http://www.ruby-forum.com/.
2006 Nov 04
0
need advice about race condition
There''s a field in my User model that sometimes needs bulk updates: User.update_all("cluster = #{new_cluster}", "cluster = # {current_cluster}") Now, suppose user with id 37 is affected by that particular update_all and updates his profile: 1. user 37 is read 2. update_all happens and changes 37''s cluster asynchronously 3. user 37 is saved
2007 Oct 12
2
missing attribute: reorder
I am trying to use an integer object as a flag item for displaying a link on a page called reorder that is a column in my PlanProcedures table. I''m getting an error that says The Header is NoMethodError in Manage_plan_procedures#list missing attribute: reorder Here is what my model looks like: >> PlanProcedure.column_names => ["id", "plan_id",
2006 Jan 23
4
ActionRecord: how to update many records in one statement
Hello, I am trying to edit and update all records of table ?intersts? (id, name, description) on one page and has no good idea how to do it right, when updating one record per page it?s ok The question is: what statement instead Interest.update_all(params[:interest]) in controller need to use to successfully update the database table by data passing to controller in parameter ?interest??
2007 Apr 24
2
remote database ActiveRecord model
Does anyone know how to make a model connect to a remote database and only for that specific model? That way I can do the typical CRUD functions on a remote server? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,
2011 May 25
1
rake task: uninitialized constant
I have this rake taks: CUSTOM_MONTHS = [nil, "GEN", "FEB", "MAR", "APR", "MAG", "GIU", "LUG", "AGO", "SET", "OTT", "NOV", "DIC"] def parse_date_string(date_string) begin day, month, year = date_string.split("-") Time.mktime(year, CUSTOM_MONTHS.index(month),