Displaying 20 results from an estimated 700 matches similar to: "Pessimistic Locking Plugin Breaks ActiveRecord::Base.count()"
2006 Jul 06
5
Single table inheritance
I''m having a class called Person, with subclasses as goalkeeper,
forward, defender.
Now a person can be a forward as well as a defender or a goalkeeper.
I want to use single table inheritance like :
class Goalkeepr < Person
end
And not have multiple boolean columns like in my people table like is
is_goalkpeer, is_forward, is_defender.
How do I go about it ?
Thanks,
Pratik
--
rm
2006 Aug 11
0
count not working?
I''m having some trouble with the count method on AR objects. Here is
a stack trace:
>> t.subscriptions.count
ArgumentError: wrong number of arguments (2 for 3)
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
lib/active_record/calculations.rb:160:in `add_limit!''
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/
2006 Apr 06
7
[Fwd: Rails AR/Oracle Unit Test: [4185] failed]
So my automated script caught this issue, though I think my email
headers were bad, so rails-core has put the automated email on hold
pending "moderation".
I''ll fix that issue, and look at the one below as well.
-------- Original Message --------
Subject: Rails AR/Oracle Unit Test: [4185] failed
Date: Thu, 6 Apr 2006 08:32:04 -0700
From: Michael Schoen
2006 Apr 02
5
adding primary_key to join table using migrations
Hi list,
My tag_question_user join table is not currently a full-blown model. It
doesn''t have a primary key - just tag_id, question_id, and user_id.
I now want to add a primary key to this model (because I want to add a
"description" column as well so users can describe the tag.
I''m not sure how to add this using migrations.
Here is what I have:
class AddNotesToTags
2008 Nov 12
5
dynamic condition for has_one and eager loading issue
Hi,
I ve defined the following relation in one of my models with a dynamic
where condition:
has_one :selection,
:foreign_key => ''object_id'',
:conditions => ''selection_type = 1 and account_id = #
{self.send(:account_id)}''
That works perfect, however when I try to eager load that relation I
am getting the following error when doing a
2006 Jul 06
6
Capistrano deployment questions == Best practice type ones
Hi everyone,
I''ve been sold on the whole idea of using Capistrano for deployment
of my sites and have successfully deployed three apps in three
different environments all with success.
As I''m trying to configure my sites I''ve encountered a number of
issues/questions hence this post.
1. Database.yml
Twice I''ve been stumped by apps refusing to work on
2006 Apr 20
1
has_many.count not accepting options hash
has_many.count does not seem to support an options hash like
ActiveRecord::Base.count does.
Example:
>> AcademicProgram.find(:first).course_requirements.count :conditions
=> "courses.name LIKE ''a%''", :include => :course
=> 40
>> ap.ap_requirements.count :conditions => "courses.name LIKE ''a%''",
:include =>
2006 Nov 03
0
How to upgrade my rails 1.1.6 with pessimistic locking feature?
Hi,
How can I upgrade my rails 1.1.6 & activerecord 1.14.4 with the
pessimistic locking feature,
described in
http://wiki.rubyonrails.com/rails/pages/Pessimistic+Locking+Plugin/versions/3?
Regards
ID
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2010 Jan 21
1
Zpool is a bit Pessimistic at failures
Hello,
Anyone else noticed that zpool is kind of negative when reporting back from some error conditions?
Like:
cannot import ''zpool01'': I/O error
Destroy and re-create the pool from
a backup source.
or even worse:
cannot import ''rpool'': pool already exists
Destroy and re-create the pool from
a backup source.
The first one i
2006 Jul 06
9
Where to put code - controller or model
I have a Rails app that is a directory indexer. It passes the desired
directory path in the url.
There is a user table, and a permissions table (which contains the
volumes each user has permission to see). There is also a volume table,
which contains the available volumes, and a path table, which contains
the paths to every file available on the machine. [There are other
tables, but these
2006 Jul 11
32
Database Concurrency Without a Web Server?
My Rails application requires a very busy worker process running in the
background at all times. I am launching this non-interactive process
using script/runner. This process is very busy and is communicating
with the MySQL server constantly. As I started putting some load on the
system to test, I started running into performance issues.
I have since discovered that Rails is only using 1
2006 Jan 13
2
New View Example With Child Object?
Could somebody point me to some example code? This must be simple, I
just can''t find any examples. I need a new view (new.rhtml) to include
the creation of a child object. I have a table for servers (Servers)
and a table for IP Addresses (Ips).
Server
has_many :ips
Ip
belongs_to :server
In my new.rhtml I want the IP entered to become a record in the Ips
table. The Ips table
2006 Mar 28
2
add_limit (in acts_as_taggable) breaks in 1.1, solution?
Upgraded from Rails 1.0 to 1.1 and found that the (slightly modified)
acts_as_taggable plugin breaks. The line
add_limit!(sql, options)
(in the tags_count method) causes this error
wrong number of arguments (2 for 3)
The documentation still says it takes two args, so I''m not sure what''s
wrong. Adding
logger.info("SQL here: " + sql)
2012 Apr 02
10
Pessimistic locking locks the entire table?
Hi guys,
I must be missing something obvious with pessimistic locking. Here is
what I do (Rails 2.3, mySQL):
In my Foo model:
def test
Foo.transaction do
lock = UpdateLockForFoo.find_by_foo_id(self.id, :lock => true)
sleep 30
end
end
For each Foo model, I have an UpdateLockForFoo. This "lock" needs to
be acquired before doing any changes to Foo.
I believe it works,
2005 Mar 24
0
PATCH for Active Record 0.9 SQL Server Adapter problem => Rails 0.11does not work with SQL Server
I just checked out the latest sqlserver_adapter.rb from the SVN
repository, and it seems to work fine.
-----Original Message-----
From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Neville
Burnell
Sent: Thursday, 24 March 2005 2:25 PM
To:
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2006 Apr 01
3
acts_as_taggable, wrong number of arguments
Hello,
When I try:
@tagged_items = Problem.find_tagged_with :all => ''kuba''
or
@tagged_items = Problem.tags_count :limit => 100
I get this error:
ArgumentError in Volume#index
wrong number of arguments (2 for 3)
RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace
2006 Jan 10
1
sql server freetds/odbc question
I''m having an error from Linux via freeTDS/ODBC to SQL Server with
cod that runs fine against SQLite and MySQL. Here''s the code:
def find_recipes_for_workorder_by_id
@recipe_pages, @recipes = paginate_with_sort :recipes, :per_page
=> 10, \
:conditions => ["recipe.workorder_id = ?", params
[:workorder]]
render :template =>
2007 Sep 03
11
MySQL has gone away
Hi,
in a production environment we are running into "MySQL server has gone
away" errors (see below) when we call rebuild_index in aaf. This happens
sporadically.
Any suggestions for what might be wrong or workarounds? I guess we try a
reconnect before we call rebuild_index?
Matthew
ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone
away: SELECT count(*) AS
2006 Mar 31
1
Ruby 1.8.4 upgrade screws up ActiveRecord
Okay, so I upgraded to Rails 1.1 on my Windows development machine and
everything worked fine. Then I went to upgrade to Ruby 1.8.4 from
1.8.2, launched WEBrick and browsed to 127.0.0.1:3000 and here''s what I
get:
Errno::EBADF in Front#index
Bad file descriptor - connect(2)
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/vendor/mysql.rb:108:in