Displaying 20 results from an estimated 800 matches similar to: "ActiveRecord: mapping column names when using legacy schemata"
2007 Apr 26
1
mapping column names in legacy schemata
I have a legacy MySQL database with a weird naming convention - all
table and column
names have a prefix ''_'' , which is annoying, and some of the column
names are misnomers.
I would like to apply a pre-defined mapping between MySQL column names
and method
names to be used in the Ruby class, without having the original column
names being visible anymore.
how can I pre-define a
2008 Jan 03
1
Thread_pool bug?
I have a previous question regarding long tasks and the thread_pool (sorry
for the dup, I didn''t see the first go through). To try and track things
down, I made a change based on a suggestion found in the archives. I moved
my import contacts worker to its own file and set the pool_size to 1.
class ImportContactsWorker < BackgrounDRb::MetaWorker
set_worker_name
2005 Dec 05
1
Lack of 'LEFT JOIN' in Oracle 8, any patch for theta style (+)
Dears,
Oracle 8 don''t support ANSI syntax with :
SELECT e.emp_id,
e.fname,
e.lname,
j.jobdesc
FROM employe e
LEFT JOIN jobs j ON e.job_id = j.job_id
but only
SELECT e.emp_id,
e.fname,
e.lname,
j.jobdesc
FROM employe e,
jobs j
WHERE j.job_id (+) = e.job_id
JOIN syntax came with 9i.
Anyone patched Rails
2007 Aug 22
3
tackle memory insufficiency for large dataset using save() & load()??
Hello List, i have been agonizing over this for days, any reply would be greatly appreciated!
Situation:___________________________________
My original dataset is a .csv dataset (w/ 2M records) with 4 variables:
job_id (Primary key, won't be used for analysis, just used for join tables),
sector_id (categorical variable, for 19 industry sectors),
sqft (con't variable for square
2008 Jan 03
0
Strange problem
I use backgroundrb for many long tasks in my system, but I''m having issues
with one in particular. Two large tasks for me are importing people and
updating companies.
def import_contacts(args = nil)
thread_pool.defer(args) do |job_id|
begin
job = ImportJob.find(job_id)
job.process_job
rescue => err
logger.error "MscWorker#import_contacts
2008 Jan 03
1
Memory leak and long process problem
I use backgroundrb for many long tasks in my system, but I''m having issues
with one in particular. Two large tasks for me are importing people and
updating companies.
def import_contacts(args = nil)
thread_pool.defer(args) do |job_id|
begin
job = ImportJob.find(job_id)
job.process_job
rescue => err
logger.error "MscWorker#import_contacts
2007 Jun 03
3
Contextual Associations
No doubt this has been covered but I''ll be damned if I can find it.
References appreciated so I can add to my library.
1. I have 3 tables in my problem: changes, environments, comments
2. changes are many-to-many to environments
3. changes has-many comments
Here''s the tricky part:
4. environments has-many comments dependent on the current
environment.
Tables:
changes,
2006 Jul 02
18
JOIN conditions
Hi,
how can I get Rails to generate SQL queries with conditions in the JOIN clause?
What I would want is:
SELECT * FROM people p
LEFT OUTER JOIN jobs j (p.job_id = j.id AND j.salary > 9999999)
I tried
People.find(:all, :include => ''jobs'', :conditions => ''jobs.salary > 9999999'')
but that generates
SELECT * FROM people p
LEFT OUTER
2006 Sep 23
1
Better rails way to join tables?
Hi,
I''ve figured out how to join tables using :joins, but is there a more
elegant way to do this using built-in rails methods?
Here is the code:
Hiringstep_Job.find(
:all,
:joins => ", hiringsteps",
:conditions => ["hiringstep_jobs.hiringstep_id = hiringsteps.id AND
job_id = ?", 1])
Thanks,
David
--
Posted via http://www.ruby-forum.com/.
2005 Nov 20
1
mySQL 5.0 upgrade - incompatible DateTime format?
I''ve upgraded to mySQL 5.0, and it''s gone pretty smoothly except that on
DateTime.now doesn''t seem to return a value that mySQL likes any more,
as seen in the following exception:
Incorrect datetime value: ''2005-11-20T15:33:12-0800'' for column ''logged_at'' at row 1: UPDATE notes SET `due_on` = ''2005-11-20'',
2005 Dec 12
2
count sql failing with unknown table....
Hey Rails People,
I''m doing my first Rails app and I''m having a newbie problem with the
count method....
Mysql::Error: #42S02Unknown table ''jobs_sectors'' in where clause: SELECT
COUNT(*) FROM jobs WHERE (jobs_sectors.sector_id = 1 )
Extracted source (around line #4):
1: <div class="sectors">
2: <ul>
3: <% for sector in @sectors
2002 Mar 06
1
Antwort: Re: Spoolss permissions, NT & XP print driver misery (2.2.2/2.2.3a/2.2.4pre)
Hi Jerry,
Thank you for this statement! ... the problem in the last days/weeks was,
no infos from the team members!
It is no big problem if something is not working. But, if we are making
tests and reports bugs/problems and so on ... And no one from the team
give a answer ! This will make us crazy, too.
You and all of the team members make a great job!
... we will see us in Goettingen!
2006 Feb 28
0
Confusion with counter and single table inheritance
I''m having trouble getting the magical counter to work in a rails app
with single table inheritance.
following is the relevant code.
thank you
class declarations
class Job < ActiveRecord::Base
has_many :vents
end
class Vent < ActiveRecord::Base
belongs_to :job, :counter_cache => true
validates_numericality_of :width
end
class Rectangular < Vent
2009 Jan 21
4
Having troubles saving a new model
My model is being created but isn''t saving. It''s like it skips straight
past saving. Any ideas why it might do this? Updating works fine.
def create
@volunteer = Volunteer.new(params[:volunteer])
@volunteer.save
redirect_to(volunteers_url)
end
And here''s what the console reads upon create:
Processing VolunteersController#create (for 127.0.0.1 at
2013 Jul 01
3
Asterisk 1.8.20 AGI function SAY DATETIME does not play anything when mode in say.conf is changed to "new"
Hi
I am using following say.conf file. Its a default file, which comes with
Asterisk installation.
When I call SAY DATETIME AGI function, it simply returns without playing
date & time. Where as if I use mode=old setting, it works. Is this a bug
or mode=new is not implemented for SAY DATETIME AGI function?
[general]
mode=new ; method for playing numbers and dates
;
2006 Aug 24
3
A new QueueWorker class
Hello all,
I''ve come up w/ a worker class that manages queued jobs using a fixed
number of child workers. Well, that''s not quite true -- a new worker is
spawned for each job, but you set the total number that may exist at once.
There are three components:
1) queue_worker.rb: The singleton worker that manages the child workers.
You probably want to auto start this. Make sure you
2003 Sep 07
1
Problem with roaming profiles
Hi
After changing from samba 2.2.7 to 3.0.rc2 I can't get roaming profiles
work. Clients Are W2K and XP.
I've also switched from smbpasswd backend to ldap. Logon path is only
set in smb.conf, not in ldap.
Storing of profiles is working but it takes very long.
I've tried logon path = \\wilma2\profile\Win2K and \\wilma2\profile.
But the clients are always storing profile in
2005 Oct 15
3
Problem with ntlm_auth
Hi
I use suse 10.0 and have problems to set up ntlm_auth for squid.
It uses samba 3.0.20 and squid 2.5.stable10
I have set up winbind and everyhting seems to work.
I've changes groupownerchip of /var/lib/samba/winbindd_privileged
to squid. squid runs as group squid.
Everyhting is working fine for several minutes.
After a while it doesn't work anymore
proxy:/var/log/samba #
2004 Oct 09
2
Groupmapping doesn't work
Hi
I got a problem with groupmapping. It doesn't work correct:
Wilma2:/home/root # net groupmap list | grep 512
Domain Admins (S-1-5-21-3371203057-3264423045-2392767973-512) -> domadm
ldapsearch -x cn=domadm:
# domadm, groups, wms-hn.de
dn: cn=domadm,ou=groups,dc=my-domain
objectClass: posixGroup
objectClass: sambaGroupMapping
cn: domadm
gidNumber: 65669
memberUid: tilo
sambaSID:
2008 Aug 11
5
Parameter "idmap backend" is deprecated ???
Hi,
why is this parameter deprecated ?
I have to set this parameter if i want to get my user/group information
from Active Directory with SFU AD schemata extension.
Is there a new parameter instead of "idmap backend" ???
Buy Andy