Displaying 20 results from an estimated 200 matches similar to: "Select distinict on not chainable with order method"
2007 Dec 12
2
possible bug in eager loading
Hello,
@users = User.find(:all, :include => {:user_data =>
:user_data_field}, :order => "username = ''someone-oHC15RC7JGTNLxjTenLetw@public.gmane.org'' desc",
:limit => 50)
This produces:
User Load IDs For Limited Eager Loading (74.648762) SELECT * FROM
(SELECT DISTINCT ON (users.id) users.id, username AS alias_0 FROM users
LEFT OUTER JOIN
2008 Oct 13
2
Subset based on items in a list.
R-help:
I have a variable ("ID_list") containing about 1800 unique numbers, and a
143066x29 data frame. One of the columns ("ID") in my data frame contains a
list of ids, many of which appear more than once. I'd like to find the
subset of my data frame for which "ID" matches one of the numbers in
"ID_list." I'm pretty sure I could write a function
2008 Jul 22
2
ActiveRecord Associations issue
Hello all and thank you for reading this message.
I am new to RoR, and ruby too, but i am quite excited about it.
I am developing a RoR project and with active record associations in
the following
manner
# Tables (all tables have only one record)
CREATE TABLE `webcars_development`.`cars` (
`id` int(11) NOT NULL auto_increment,
`model_id` int(11) NOT NULL default ''0'',
2012 Mar 28
1
collection_select
_form.html.haml
= f.label :Select_Brand, "Select_Brand<em>*</em>".html_safe
= collection_select(:brand_name, :brand_id, Brand.all, :id, :name,
:prompt => "Select a Brand" )
show.html.haml file
%table
%tr
%td
Brand_Name :
%td
= @message.brand_id
After writing this code I am not able to see the brand name. Its not
giving any error but
2006 Jun 30
0
Interpolation in association conditions broken; broken backwards-compatibility?
I believe it used to be possible to interpolate values into
associations'' conditions with single quotes, but it isn''t anymore.
has_many :widgets, :conditions => ''brand_id = #{brand_id}''
Anyone else remember that? It seems to have been snuffed out in
changeset 3897 with the removal of interpolate_sql(@conditions)
Was the change (and the fact that it
2010 Jun 17
1
Problem with options_for_select
Hi,
I have a problem with the form select. In the value field I have the
generated html...
<%= f.select :brand_id,
options_for_select([[''Brands'', 0]] +
@search_brands.map { |b| [b.name, b.id]}),
{:id => ''cbxBrand'', :tabindex => (@tabindex += 1)} %>
This is the html:
<select name="search[brand_id]"
2007 May 30
2
newb trying to figure out ActiveRecord relationships
3 tables. item, brand, commercial
item
--------
id
name
brand_id
name
brand
---------
id
name
commercial
----------
id
item_id
The idea is that a commercial will have one item.
each item will have brand.
and a brand may have zero to many items.
I can''t figure out how to make the relationships for my models.
Eventually, i''d like to be able to show a brand name from a
2006 Jul 19
5
weird result for a custom attr reader!
Hi all,
I am having a weird problem reading a value from my model. basicaly, I
have these two models:
class Category < ActiveRecord::Base
acts_as_tree :order => "name"
belongs_to :item_type
has_many :specific_category_names
end
and
class SpecificCategoryName < ActiveRecord::Base
set_table_name "Specific_category_names"
has_many :products
belongs_to
2006 Aug 09
1
Migrating a Field to External Model
I have a model Product with an attribute ''brand''. Currently it is a
simple attribute, however, I am migrating it to a separate model
Brand so that I can have other attributes with each brand. I created
the the model and created and ran the migration to create the new
table. So far so good. Then I created a separate migration to
transfer the data. The up method
2006 Jul 15
1
Relationship problem, newbie problem, need help!!
Hey all
I seem to be having some problems with my relationship between a few
tables...
If i then run the following query in mysql, i get the data i want. How
do i do this in rails relationships and models?
select * from shop_addresses
left join shops on shops.id = shop_addresses.shop_id
left join styles on styles.id = shops.style_id
where shop_uri = ''127.0.0.1''
Cheers!!
2006 Feb 15
3
Like Query Across Multiple Tables
Firstly, I''m still learning Ruby and rails, so there could be a very
simple solution to this.
I want to search across multiple tables with a "like" query eg: (SQL is
probably the easiest way to describe it):
select
products.*
from products
inner join brands on products.brand_id = brands.id
where
products.name like ''%canon%''
or brands.name like
2006 Sep 28
15
Inserting rows into linking table
Hi,
I have two objects:
Contacts
Lists
I want to be able to add multiple contacts to multiple lists.
I''ve created a linking table and a form that allows me to select the
contacts using checkboxes, but I''m having some problems with the
controller and model.
I receive the following error message when I submit the form:
Mysql::Error: Cannot add or update a child row: a
2009 Jun 02
9
XML::LibXML::Reader
is there anybody who knows how we can get child values using libxml
(Reader class)
def xml_import_to_brands
require''xml''
reader = XML::Reader.file(''c:/brands.xml'')
.
.
.
2009 Jul 23
11
Problem with named_scope
Here are my scopes:
default_scope :order => ''posted_on DESC'', :conditions => { :status =>
''visible'' }
named_scope :positive, :conditions => { :rating => ''positive'', :status
=> ''visible'' }
named_scope :neutral, :conditions => { :rating => ''neutral'', :status
=>
2013 Sep 02
1
Problem with Filling Tables.
I have an application that has models for beer styles.
Every beer style will have a name and description. It will also contain
a list of beer models.
Every beer model will contain a name.
I want my application to fill in the list of styles with some default
data.
#Beer migration file:
class CreateBeers < ActiveRecord::Migration
def change
create_table :beers do |t|
t.string
2006 Jun 20
1
Performance tweak when local files are not served by mongrel
Hello Zed !
I''ve experimented a simple but limited performance tweak in the mongrel
rails loader.
With the following apache 2.2 mod proxy loadbalancer setup :
# Redirect all non-static requests to cluster
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]
We can assume that mongrel is called only when the
2018 Nov 19
4
ssh-agent decrypt
moronic monday (pst) question time.
this may have been covered elsewhere, and emphatically shot down (and
if so, I apologize), but I'm interested in using ssh-agent to decrypt
data.
ssh certificates are the most secure user auth token we have, and even
though ssh certs aren't chainable, we routinely use them to assert
identity to things other than ssh (eg. if you can present a cert
2002 May 29
5
installing printer driver on Samba 2.2.4
My samba server works in a NT 4.0 domain. The users can print fine (mostly Win9x).
Now i'm trying to use Win2K workstation to upload drivers. I can see the printers, the properties are available but we i try to add a driver it fails with the following error : "Can't install driver Intel Windows 2000. Can't compleet statement" (translated from dutch).
I've include my
2006 Nov 21
5
Re: iptables rule not matching after stream begins
Trying again, after re-subscribing:
On 11/20/06, Bob Beers <bob.beers@gmail.com> wrote:
> Hello,
>
> I want to dynamically create DNAT rules for
> RTP streams (port-mapping for a SIP proxy).
>
> If my proxy adds the rule before the first packet
> of the RTP stream hits the port, all is well. But, if
> the stream begins arriving before my rule is in
> place,
2002 Nov 21
1
Out of connection structures
Hi,
I still have the problem of "Out of connection structures" with Samba
2.2.6 or 2.2.7 and TSE clients.
This problem was encountered by Richard van Beers :
> From: richard van beers
> To: jra@samba.org (Jeremy Allison), Gunther Hess
> Subject: Re: Samba and Out Of Connection Structures from Terminal Servers (was on Solaris)
> Cc: