Displaying 20 results from an estimated 400 matches similar to: "Update join_table attributes"
2006 Jan 29
9
Specify options with habtm
Hi all
I have the following models:
class member
has_and_belongs_to_many :disc_jockeys
end
class disc_jockey
has_and_belongs_to_many :members
end
The relation table is called disc_jockeys_members and has the following
fields:
disc_jockeys_members(disc_jockey_id, member_id, status)
So far, the field status can have values like valid, invalid, locked
etc., but it is not regarded yet by
2006 Aug 18
9
Rails is doing what I want - but I don''t understand how.
Hi guys, I have the strangest thing happening. The funny part is its
doing exactly what I want to do, I just don''t understand how.
Basically here is my model.
class Role < ActiveRecord::Base
has_and_belongs_to_many :users
has_and_belongs_to_many :rights
def self.names
names = Array.new()
for role in Role.find :all
names << role.name
end
return
2006 Jan 09
13
Ajax Tabs
hi railers,
I have a model/view/controller with many associations (20+). I would like to
display the relative associations using AJAX, allowing the user to display
the association his/her is interesting at a particular time. Is here any
kind ajax tabs helper or some kind of tab widgets that I can easily
incorporate into my rails application.
regards,
leon
-------------- next part --------------
2006 Jan 09
3
Include with two references of one model of the same table
Hey guys,
I just came across this oddity, not sure what to make of it yet, but
I think it might be incorrect behavior. When doing a @inst.find(:all,
:include => ["hometeam", "awayteam"] ...) hometeam and awayteam are two
references from a belongs_to that is of the same model and of the same
table. I will get a pgerror stating that "matches", which is
2006 Jan 09
4
Problem with habtm and resulting SQL insert
Cheers,
I have a problem with 1.0 and a habtm relationship between User and Article.
I want to save all articles that users read. I have these models:
class User < ActiveRecord::Base
has_and_belongs_to_many :read_articles, :class_name => "Article",
:join_table => "read_articles"
...
end
class Article < ActiveRecord::Base
has_and_belongs_to_many :readers,
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
2006 May 16
4
Problems with multiple ''id'' columns in a join_table
I have a problem declaring a relationship through a join_table ; the SQL
generated by ActiveRecord is correct, but there are two columns called
''id'', and the final object gets the ''wrong'' column ...
Here''s a more detailed description of the data, code, and problem :-
There''s a People table, with id, name, and a few things.
Also a
2019 Aug 19
6
Segfault with error 4 in doveadm-server
I set up dovecot on two servers with replication enabled. The replication is over a vpn connection.
I get massive segfaults from doveadm-server every few minutes.
dmesg:
doveadm-server[30030]: segfault at 0 ip 0000557fa16d2e62 sp 00007ffdcaafec50 error 4 in doveadm-server[557fa16a3000+41000]
[486397.225636] Code: 40 03 4c 8d 3c c3 48 8d 44 24 18 48 89 44 24 08 0f 1f 84 00 00 00 00 00 49 8b bc 24
2006 Jan 04
11
Query Mixin by Duane Johnson
Hello
At the start of October, Duane Johnson announced the Query mixin plugin on
this list. The code was attached to the announcement email. Unfortunately,
I''ve not been able to locate the attached code. Goggle has not helped me
this time. Could somebody forward it to me?
Thanks in advance
Harvey
This e-mail has been scanned for all viruses by MessageLabs.
2005 Dec 22
7
Ruby on Rails and lookup tables
Hi,
I''m a newbie on both Ruby and Ruby on Rails, and I''m struggling with
my first app. I have a table with a column called "employee_id" which
is a foreing key associating it with the "employees" table. I have
populated both tables.
When I run "ruby script/generate scaffold <model name> <controller>"
it generates a web page with all
2006 Mar 22
2
habtm vs. has_many/belongs_to
In AWDWR David says (pg 232),
"When a Join Wants to Be a Model:
While a many-to-many relation with attributes can often seem like the
obvious choice, it?s often a mirage for a missing domain model. When
it is, it can be advantageous to convert this relationship into a
real model
and decorate it with a richer set of behavior. This lets you
accompany the
data with methods.
As an example,
2006 Jan 09
3
Thomas Fuchs Interview on Audible Ajax
Hi guys,
I had the pleasure of interviewing Thomas Fuchs for "Audible Ajax", and
thought that some of you may be interested to hear it:
http://ajaxian.com/archives/audible-ajax-episode-12-thomas-fuchs-of-scriptac
ulous
Cheers,
Dion Almaer
Founder, Ajaxian.com
http://ajaxian.com
Cleaning up the web with Ajax
2006 Jan 24
2
NULL id''s / invalid references
Hi,
could you suggest me how to handle this in a proper way? I have a table
which has
othertable_id column (relationship is belongs_to) Problem is, that
sometimes there is a NULL value and table.othertable.foo returns an
error... what should I do about it? change something in model? in view?
or just add "unknown" row to othertable and update table.othertable_id
with id of this
2005 Dec 30
2
Beauty in Page Layout
Hi Railers,
I have a model with many associations (20+). I would like to display the
relative associations using AJAX, allowing the user to display the
association his/her is interesting at a particular time. Is there any
existing applications or sample code that I can look at to accomplish the
task?
Present I have one long page, with master (displaying current record
information) and many
2006 Jan 15
8
Underscore character in session var
I stumbled across a weird problem
i can do:
@session[:userid] = 1
but cant:
@session[:user_id] = 1
The second session var doesnt set.
Is there a config setting for this?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 14
6
Rails on Sun
Hi Everbody,
I''ve got a potential idea for introducing Rails to my company. My only
shot at this is to minimize what our Ops guys would have to install and
configure to get this up and running.
Right now, our servers are Solaris boxes and we are using Sun ONE as our
web server.
Anyone got Rails running in this environment?
Also, has anyone got Rails talking to Oracle databases?
2006 May 23
6
OT: best books
Hopefully this isn''t completely inappropriate, but lately I''ve been curious
about what books people have found most helpful in their development as
programmers. If one of the icons like Dave Thomas, DHH, Mike Clark, Andy
Hunt et al could weigh in that''d be awesome :)
Here are some of my favorites:
Refactoring, Martin Fowler
Mastering Regular Expressions, Friedl
2006 Jan 10
5
Oracle 10g Express - generate scaffold gives error
Hello,
I have Oracle XE installed.
I have a table USERS.
When I try to generate a scaffold it gives me this error.
I tried also with Mysql and it worked.
E:\radrails\projects\MPS>ruby script\generate scaffold user
exists app/controllers/
exists app/helpers/
create app/views/user
exists test/functional/
dependency model
exists app/models/
exists
2006 Jan 11
8
Oracle and Rails seems really slow.... In development
I''m just looking into how to connect to Oracle using Rails. I''ve got
everything connecting and working as it should.
I have a Users table in Oracle:
create_table "users", :force => true do |t|
t.column "username", :string
t.column "created_on", :datetime
t.column "email", :string
t.column "note", :text
2006 Jan 02
5
NoobyQ: how to work with a table of static lookup data??
Hello out there!
Nooby question: What''s the "Rails" way to work with tables of relatively
static lookup data?
Objectively (I''m thinking); I don''t want to hit the DB each time, so for
each lookup table, initialize a globally available hash with lable/value
pairs...
Am I on the right track?
How would you do this kind of thing in Rails?
Thanks!
--