Displaying 20 results from an estimated 2000 matches similar to: "join and sort on 'best match'"
2006 Jan 20
6
HELP: acts_as_taggable problem with :clear => true
I''ve got the basics of acts_as_taggable going, but I now want to use
:clear => true on the tags method, because the tags I''m supplying as
parameters are the complete set of tags for the item, not additions to
existing tags.
Problem is, that gives me a nasty SQL error ...
Unknown column ''id'' in ''where clause'': UPDATE items_tags SET
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)
2006 May 07
6
Challenging SQL for you...
Gents,
My heads been out of the sql game for too long (or it''s simply too early).
I''m trying to extend the acts_as_taggable plugin (note: not gem) so that
you can specify a list of tags you''re interested in, and the plugin will
return only those items that are tagged with *all* these tags.
The plugin uses primarily two tables: tags, to keep all the various tag
2006 Aug 29
2
Excluding values from search term
I''m trying to do a search that would exclude a value from it and return
whatever results aren''t matched from the term, but it''s not working very
well.
None of these are working, they all return the results including the
ones with tag_id = 701
tag_id:(NOT 701)
tag_id:(! 701)
tag_id:(- 701)
But if I go the other way around it works (which I don''t want since
2013 Jan 25
3
how to delete the null elements in list
HI,
I have the list:
> suu
[[1]]
NULL
[[2]]
NULL
[[3]]
item_id prod
1 2
[[4]]
item_id prod
1 2
2 4
how to delete all "NULL" elements from suu to get only
>suu
[[3]]
item_id prod
1 2
[[4]]
item_id prod
1 2
2 4
??
Kind regards,
Tammy
[[alternative HTML version deleted]]
2006 Jul 31
1
How to get result of following SQL Query in Ruby?
Hi,
I have 2 tables as follows:-
_________________ ________________ ____________
taggings | |stores | | tags |
-----------------| |---------------| |------------|
--tag_id | |--store_id | |tag_id |
--store_id | |--store_name | |tag_name |
--user_id | |---------------| |------------|
-----------------|
Now I want to execute
2010 Feb 14
2
has_many :through eager loading only loading one record
Hello,
I''ve been using Rails for years, including has_many :through and eager
loading, but this one has me stumped.
The problem is that Active Record is only eager-loading the first of
many records. Here are the models (note set_table_name for a legacy
schema):
class Tag < ActiveRecord::Base
set_table_name ''tag''
end
class DishTag < Tag
has_many
2006 Mar 31
7
problem with habtm conditions in pagination
Hello list,
I''ve had this problem for two days now. Perhaps someone here would
care to comment on it. I''d be REALLY appreciative if that''d be the case.
Basically, it''s outlined at this paste: http://rafb.net/paste/results/
kXQSHZ83.html
But I''ll paste it here, too.
The main problem is in the customers/list action. The problem is with
this line:
2006 May 27
2
Error, in my store provider.
Let me explain the subject title, store provider is Hackey, he''s a NPC
that sells items to my users.
<h1>Welcome to Hackey''s!</h1>
<h3>Catalog</h3>
<table border="2" bordercolor="red">
<% for items in @items -%>
<% temp12 = Item.find(items.item_id) -%>
<tr><td><%= @temp12.name
2006 Jun 22
2
id column for join table... kosher?
I''ve got two tables, bookmarks & tags. Using a
has_and_belongs_to_many association, I can do lookups using a join
table called bookmarks_tags. Two questions:
1. Can I have a migration for my join tables? Rails seems to "know"
about join tables implicitly from the associations, but if I do a
rake migrate the join tables won''t be built. I''ve been
2010 Jan 15
1
Chaining queries in ActiveRecord
Hi all,
Stuck at this problem for several days. Tried to use named_scope,
scope_out, and plugin such as searchlogic, but no result.
The problem is as follows: I have a pic table and tag table, and a
join table called pic_tag (with only pic_id and tag_id) so that I can
associate N pics to M tags. This is the tutorial way to set up a many-
to-many association. I''m trying to implement a
2006 Mar 29
3
Self-referential many-many joins with :through
I thought I had this nailed but.. now I''m seeing spots..
I''ve included my models below, feel free to ignore them. I''m really
just after an example that works. I couldnt find one on the wiki...
which is fair enough considering Ricks patch:
http://dev.rubyonrails.org/changeset/4022 that fixed them only went
through 5 days ago..
Cheers
-henster
2007 Mar 04
3
Dynamically setting the image directory used by attachment_fu
It took me a while to figure this out and I don''t see any wiki pages
for attachment_fu so I figure I would just post this here.
I didn''t like the way attachment_fu by default creates directories
under a given directory for a specific class e.g.
item_image/1/img_1.jpg
item_image/1/img_1_thumb.jpg
item_image/2/img_2.jpg
item_image/2/img_2_thumb.jpg
item_image/3/img_3.jpg
2006 Aug 09
1
help:sql search for NULL
Hi,
I have two tables with identical fields(assignments, and matches).
However, only one of them accept NULL values for its fields. I want to
be able to find out all the matches for any assignment. The search
should retrun the match if the corresponding filed is NULL as well.
I wrote down the following code but it doesn''t return anything. I wonder
what I am doing wrong. Any help is
2007 Nov 16
1
drag & drop list needs refreshing
Hello guys, I''m a scriptaculous newbie (I started working with it only
yesterday) and I have already the first problem.
I''m trying to implement a drag & drop list (fallowing the shopping
cart example http://demo.script.aculo.us/shop) and I''m almost done
but after dropping an item on the target div I need to refresh the
page to see that the item has been moved.
2005 Sep 06
6
strange behavior of acts_as_taggable
I was testing my models with this new library and I got:
>> s.tag "warp"
ActiveRecord::StatementInvalid: ERROR: inserción o actualización en la tabla
«tags_stories» viola la llave foránea «tags_stories_story_id_fkey»
DETAIL: La llave (story_id)=(8) no está presente en la tabla «stories».
: INSERT INTO tags_stories ("tag_id", "story_id") VALUES
2008 Apr 23
1
Validation dependent on unsaved parent
I''m having trouble with a validation that depends on an attribute of a
belongs_to parent. If the child is added to an unsaved parent
(parent.children << new child), the has_many collection
parent.children includes the unsaved child. However the belongs_to
attribute child.parent appears to be nil until the parent has been
saved. Without access to the parent attributes, the validation
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 May 29
4
has_many <-> belongs_to trouble
Hi all, finally im starting with rails, i have a simple relationship
has_many ans belongs_to that i dont now how to manage the update action,
here are my models
class Item < ActiveRecord::Base
has_many :images
end
class Image < ActiveRecord::Base
belongs_to :item
end
And my table structure:
Items => id, title, desc
Images => id, image, item_id
ok, i have a number of
2006 May 03
2
render partial collection
my view contains a call to a partial:
<%= render(:partial => ''item_list'', :collection => @keyword.synonyms,
:locals => { :action_delete => "removesynonym", and_some_other_stuff
})
%>
_item_list.rhtml contains:
<%= link_to (
image_tag(''/images/deletebutton.png''),
{ :action => action_delete,
:id =>