Displaying 20 results from an estimated 4000 matches similar to: "Reaching into a has_and_belongs_to_many - will :through work?"
2008 Feb 12
8
has_many through question
I have made 3 tables
+------------+ +----------------+ +------------+
|people | |people_campaigns| |campaigns |
+------------+ +----------------+ +------------+
|id :int | <----> |people_id :int | /-> |id :int |
|name :string| |campaign_id :int| <-/ |name :string|
|etc ... | |exported :int |
2010 Aug 18
6
Once I added this HABTM, one of my 'through' relationships, on a non-habtm model, seems to have broke?
I''m a rails newb and have been Googling about this, but I''m still stumped.
Not showing everything here, but basically it should be a pretty common
setup so I''m sure others know what I''m doing wrong.
- A meter can belong to many meter_groups
- A meter_group can have many meters.
- A user can ''subscribe'' to viewing a meter_group (Subscription)
2007 Dec 18
2
Active Resource and non default model names
I have a model (accessed restfully) named TranscoderQueue, it''s name
is overridden to ''TransocderQueue'' so it is accessed as ''/
transocder_queue'' as opposed to ''/transocder_qeueus''.
class TranscoderQueue < ActiveRecord::Base
belongs_to :campaign, :class_name => "Campaign", :foreign_key =>
"campaign_id"
2006 Feb 08
1
Possible AGI Bug in Asterisk?
Dear All,
I seem to have stumbled across an AGI problem;
I have written an AGI Script (bottom of this email);
The script does the following;
Makes a CDR entry when called
Records the call
Updates the CDR
Finds a corresponding DNIS from the SMDR table (captured via a serial
port logger)
Matches up the record and updates the CDR.
The script works perfectly in my test lab and has been doing so
2006 Dec 02
0
has_and_belongs_to_many and finder_sql options
Hello everybody,
I''ve been hit by the bug described at
http://dev.rubyonrails.org/ticket/1732
Is there any reason why the patch is still not included in trunk ? The
patch seem simple enough.
Regards,
--
Damien Merenne
http://blog.cosinux.org/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2005 Feb 04
1
vicidial and mysql ........help
hi all.....well ive installed each and everything according to the scratch
installation but the problem is when i try to login a user through
vicidialgui application it gives an error that there are 0 leads in the
hopper to dial....well im pasting the result of a few queries .....plz if
any one can do help me out ....
this is what the error looks like...
SELECT count(*) FROM vicidial_hopper
2006 Mar 20
2
AHHHhhhhh... has_and_belongs_to_many, that is going on?
I don''t have a class by the name of "ReviewersScoreCard", yet my many to
many configuration looks as follows. And, these errors while running some
simple test with ./script/console is giving me a headache:
./script/console
Loading development environment.
>> r = Reviewer.find_first
=> #<Reviewer:0x19d0a48 @attributes={"id"=>"1",
2006 May 08
2
Queries with has_and_belongs_to_many relationship
I was able to create a has_and_belongs_to_many relationship for my app,
but now I''m not too sure how to write queries for it.
Basically, I have a table ''courses'' that has_and_belongs_to_many
''categories'' and vice versa
So I''m trying to figure out how I would find only the courses that
belong to a category that I specify.
Let''s
2006 Apr 06
3
has_and_belongs_to_many find
Say I have a post model that has_and_belongs_to_many :categories, and a
category model that has_and_belongs_to_many :posts. So I have a
categories_posts table to do the join. That''s all find and dandy.
However I want to be able to find all the posts that belong to a
specific category.
I tried Post.find_by_category(:id) but that doesn''t work.
Does anyone have any insight?
2006 May 11
1
ActiveRecord collection_select and has_and_belongs_to_many
Hello everyone, first post to the list and a relative newbie to Rails
development. Done quite a bit of JSP, PHP, HTML, XML etc and thought I would
kick the tires on Rails to see if it can speed up development for internal
applications. Anyway, I am running into a problem that is just driving me
crazy and everything I read on the net doesn''t seem to help. I was hoping
someone here might
2006 Feb 09
1
Re: Help on Vicidial
Here is another log from the * server CLI, I reall hope some one can help me
out on this one. thanks
|SELECT count(*) FROM vicidial_auto_calls where status = 'LIVE' and
server_ip='127.0.0.1' and
campaign_id = '' and call_time < "" and lead_id != '';|
-- VDAD get agent: |0|update of vla table: |127.0.0.1
|UPDATE vicidial_live_agents set
2012 Sep 08
3
Polymorphic has_and_belongs_to_many association
Hi,
I''m currently having the situation where I have to implement a polymorphic
has_and_belongs_to_many by introducing an in between model that handles all
the "has_many :as" and "belongs_to :polymorphic" association
implementations... and is not doing anything else. Thing I don''t like it
here is, I am unnecessarily loading AR instances only to execute SQL
2006 Jan 19
5
limits of has_and_belongs_to_many
I''m experimenting with Rails on the Recipes example first before I dive
into applying it to my intended application. I''m exploring which will be
more work: to rename all the primary id''s in the legacy database, or to
work around the fact that the primary id''s are not called ''id'' within
RoR instead.
I''ve been successful in using a
2005 May 23
1
has_and_belongs_to_many dual insert error ?
Hi !
(See references at the end)
I have a slight problem. Whenever I save one of my domain models, which
contains an has_and_belongs_to_many relationship with another one, the
relationships are doubled.
My domain is a series of pictures, where each picture can be tagged with
one or more words. So, a picture of my dog could be tagged "Jordy, Dog,
Dog 2005", for example.
In my
2006 Mar 09
2
has_and_belongs_to_many -- how to create test fixtures?
Hallo -- can anyone offer me any pointers as to I should handle
many-to-many relationships in Rails tests?
Cheers,
doug.
--
Posted via http://www.ruby-forum.com/.
2006 May 23
7
has_and_belongs_to_many question
Hello,
I am trying to make the "switchover" to programming my apps in Rails and
have a question about database structure.
In the past i would structure a many to many like this:
categories
----------------------------------------------------
| id | name |
----------------------------------------------------
1 Some Category
2 Another
2007 Oct 19
1
Managing a lopsided has_and_belongs_to_many relationship
I''ve got a fixed list of several thousand Things, and a User base that
may grow to who knows how big (we can only hope ,right?) Users have and
belong to many Things. I want to display a list of top Things, based on
how many users each has. Things with 0 users are not displayed.
Two questions. First, I expect the density of the relatioships to focus
on a small percentage of the
2006 Mar 07
1
has_and_belongs_to_many tags
I''m trying to create a search where I can find pages by their tag name.
Here''s a sample of my code (not working).
@tags = Page.find(:all, :conditions => ["#{:tag.name} LIKE ?",''%'' +
@params[''searchtags''] + ''%'' ])
My enviroment:
I''ve got a table called tags, and a table called pages, both with a
2005 Mar 02
1
Cleaning up has_and_belongs_to_many?
Does has_and_belongs_to_many know to delete an object when the last
reference to it is removed?
In my case I have Receiver <<->> Message (with a join table of course),
but have noticed that when the last receiver removes a message from the
association the message still exists.
Before adding code to manage this situation I want to check to see if I
am missing something?
--
2006 Dec 25
2
how to insert data using has_and_belongs_to_many
I''am newbie in RoR, so my question might look stupid, but I stuck in one
thing.
I''ve created 3 tables:
users{
id,
user
}
books
{
id,
book
}
books_users{
book_id,
user_id}
Model
class Book< ActiveRecord::Base
has_and_belongs_to_many:users
I can''t figure out how to insert data to the books_users table.
For example users post info about new book and information