Displaying 20 results from an estimated 3000 matches similar to: "sql question for rails"
2006 Jul 02
2
searchbar help!
Hi all,
i am after hours unfold of trying to implement a searchbar in a table
with a habtam relashinship, but alas ! with no success... i was hoping
some kind gentle mind can help me through these diffucult times; i have
now reached the point where out of sheer annoyance, i cannot see myself
getting anywhere nearer to the target, and was hopefully hoping one of
you out there could help me
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
2008 Jan 20
9
Ferret Gem Installation on Windows
Trying to install ferret on my windows XP environment. Using
InstantRails 2.0 with RoR 2.0.2, and NetBeans 6.0. I had successfully
installed and built RailsSpace in InstantRails 1.7, but am trying to
upgrade RailsSpace to RoR 2.0.2 using the code that Michael has kindly
provided for us on the website.
When I run the gem install ferret command, I get the following error:
C:\Documents and
2006 Jul 03
6
help!
Hi,
i''m fairly new to ruby on rails, and i know the question at hand may
seem simple at first, but i''m getting really caught up in trying to
understand this and the docs aren''t giving me answer. i actually thought
i knew how the sql commands work (like :include, :conditions, :etc) but
obviously, i don''t.
there are three models M1, M2, M3 joined by a habtam
2005 Dec 15
3
How to delete a record
hey,
i my database i have users and groups, each user can get in different groups
my db structure:
table groups: id, name, basegroup, firm_id
table users: id, firstname, lastname, email
table groups_users: group_id, user_id
my relation is a many to many:
class Group < ActiveRecord::Base
has_and_belongs_to_many :users
end
class User < ActiveRecord::Base
has_and_belongs_to_many
2006 Jan 28
6
Check if user is in right group
What is the best way of checking this?
I have 3 tables:
groups
users
group_members
class GroupMember < ActiveRecord::Base
belongs_to :group
belongs_to :user
validates_uniqueness_of :user_id, :scope => "group_id"
Then I want a method here that checks if a given user is a member of a
given group. What is the right way of doing that?
def
2006 Jun 29
1
search action/ in different groups
Hi all,
thanks in advance for those who''ll take the time to help out...
i have a list of users who are connected with a habtam relashinship to a
set of groups (joint table of groups_users) and now am trying to
implement a search operation that will go through all of the records of
the users and output user results according to what group was chosen at
the searchbar, and the text
2009 Sep 10
2
Problem Deleting IMAP Folders
Hello,
In my configuration I have
mail_location = maildir:/Mail/frank.gr/%n:INDEX=/Mail/frank.gr/
__Indexes/%u
I can create new folders in an IMAP session, but when I try to delete
I get permission denied.
From the LOG
Sep 10 13:20:06 IMAP(stuart): Error: unlink_directory(/Mail/frank.gr/
__Indexes/stuart/.TEST) failed: Permission denied
ls -ald /Mail/frank.gr/__Indexes/stuart/.TEST
2006 Mar 14
7
Overriding new or create for a model
I have a model where I need to calculate one of the fields when I create
a new instance. It seems to me that I should do this in the model code
and that I should override the new and/or create methods.
Is this the right approach and, if so, how can I execute the existing
method but add on my calculation?
I want something like:
def create
-Do the original create first-
field =
2006 Jun 16
4
problem with join
Hi all,
I''m having a problem with a join inside a paginate, the code is like this:
@ruta_pages, @rutas = paginate :rutas,
:conditions => conds_arr,
:joins => "AS ru LEFT JOIN vehiculos AS ve ON ru.vehiculo_id = ve.id",
:per_page => 10,
:order => "fecha DESC"
The problem with this, is that the query returns the
2006 Mar 22
10
Need for multiple acts_as_list
I have a model "Childmodel" that belongs_to two other models "Parent1"
and "Parent2". "Parent1" "has_many :childmodels, :order => :positionp1"
and "Parent2" "has_many :childmodels, :order => :positionp2". i.e. The
child is independently positioned within each of its parents.
This works fine and gets me the useful
2006 Jun 19
3
Using a records "id" in validation
I need to use an order''s id value in a validation. Basically, I am
charging an order via a credit card API. I only want ot save the order
if the credit card authorization was approved. I also want to send the
order id to the credit card API as a transaction reference. And last
but not least I want to add an error to the order object if the
transaction is declined.
The problem is
2006 Jun 26
4
has_many :through
first, the models:
class Listing < ActiveRecord::Base
has_many :keyword_links
has_many :keywords, :through => :keyword_links, :conditions => "active =
1"
end
class Keyword < ActiveRecord::Base
has_many :keyword_links
has_many :listings, :through => :keyword_links, :conditions => "active =
1"
end
class KeywordLink < ActiveRecord::Base
belongs_to
2007 Sep 13
5
refreshing indexes?
I am new to ferret and am just reading about it in the O''reilly
shortcuts as well as other web resources. My app is a Rails app and so
I am looking into acts_as_ferret as well. There are some questions for
which I couldn''t find answers in the material I have read so far so
I''d appreciate any help on these from the list.
A bit of a background. My app will have 10,000 -
2005 Mar 17
4
Hi there..
Hello Everybody,
This is Bharat here. I am on the way of learning
Asterisks, and I just wished to know how I go about if got to write
dailplans for outbound calls and inbound calls. If you could provide me with
a simple example, I could get thru.
Waiting for your response
Regards
Bharat M. Sarvan
-------------- next part
2005 May 25
5
C files of Asterisk
Hello Everybody,
I was going thru the C code of Asterisk. Does
anybody know how does one go about modifying the C code of Asterisk? Please
do reply.
Regards,
Bharat M. Sarvan
EZZI BPO Pvt Ltd.,
PUNE.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2012 Nov 08
3
strsplit with invalid regular expression
Hi all,
> diff_operator <- "\\("
> strsplit(cond, diff_operator)
[[1]]
[1] "andsin" "log_angle_1_4)"
> diff_operator <- "\\sin("
> strsplit(cond, diff_operator)
Error in strsplit(cond, diff_operator) :
invalid regular expression '\sin(', reason 'Missing ')''
When I am going to split with "("
2008 Jan 18
6
Odd transfer speed issue
Hi all,
I'm seeing slow transfers to/from my samba server. I just tried to copy a
270MB file from a samba share to an XP machine. At first, the estimated time
displayed as 141 minutes :(
The odd thing is that if I then flood-ping from the server (in this case, I
pinged my dsl router), the transfer completes in about 10 seconds. Hitting
F5 repeatedly when browsing a share on the server
2008 Jul 01
8
InstantRails
Does anyone know if InstantRails will be upgraded for Rails 2.1? I see
a lot of threads where people are discussing problems upgrading from 2.0
to 2.1. I would rather wait for InstantRails2.1 if it was close?
Thanks.
Bharat
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
2011 Nov 18
1
Drawing ticks in the 3rd and 4th row of a lattice
Dear all,
I want to draw ticks on the 3rd and 4th row of a lattice. How do I do this
? In my search of the help, I discovered a parameter alternating,which kind
of says where the ticks will be but does not suffice for me.
I am running this command : -
barchart(X03/1000~time|Company,
data=df1[which(df1$time!=1),],
horiz=F,