Displaying 20 results from an estimated 1000 matches similar to: "legacy database and finder_sql nightmare!"
2006 Jan 18
3
legacy database on remote host
I''m getting this error in webrick then it crashes leaving nothing in the
log.
ruby: symbol lookup error:
/usr/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.so: undefined symbol:
mysql_sqlstate
Here is the standard query I would normally write to get the data.
select * from child,parent
where CONCAT(SUBSTRING(child.item_number,1,14,''00'') =
parent.order_number and
2006 Jan 18
3
I need superman!
I have a legacy database that I can''t figure out. I''ve tried hundres of
times and spent way tooooo much time trying to figure this out. I don''t
think that rails can do it. Maybe there is a superman here who can get
this too work. I''m going to post my sql dump to produce a very simple
database. If anyone can get rails to work with this THEY WILL BE MY
2006 Jul 04
1
mysql_adapter.rb help please
I am an experienced systems programmer (20+ years) trying to get RoR
working on a Centos server with WHM, Cpanel, etc. Everything seems OK
and I am able to run the hello world apps however I am having major
problems when I enable some database access ala the cookbook tutorials.
Whether I run mongrel or webrick I am getting seg faults and/or traps in
mysql_adapter.rb when I submit a form of
2006 Jan 01
7
[ ANN ] Hieraki2
Happy new year! Hieraki 2.0.0 is released.
You can download Hieraki2 from rubyforge.org as tgz or zip
(http://rubyforge.org/projects/hieraki).
Hieraki2 has a new wiki engine that ships with more than a dozen new
features:
* everything-is-a-wiki-page (TM)
* all pages are under version control
* access control list
* stay in full control of the tree structure by cut and pasting
2006 Mar 14
4
has_one
I''ve got an order model that stores order data.
One piece of data is a credit card type, which is a digit 1,2 or 3.
I have a cardType model that has an id, shortName and LongName for the
credit card merchant (visa, mastercard, amex).
I want to be able to say: order.cardType.shortName, but can''t seem to
get has_one working. It works with has_many and a finder_sql statement
on
2006 Feb 14
6
[newb] Find vs Find :all question
I''m playing out with writing an online store.
So far it has accounts, addressbooks, and orders, and those 3 are tied
together with an customer ID. I also have orderDetails, which are
associated to the order via an order number. See models below...
When I do the following I can access the orderDetails information just
fine:
@order = Order.find(params[:id]) # i pass it a customer
2005 Dec 12
2
How to use arbitrary relationships in Activerecord
How can I ask ActiveRecord to make it''s "has_many" code to work on some
arbitrary relationship between two tables? ie neither field is a primary key
The situation is that I am writing a Postfix management application and
one of the tables to manage is the "alias" table. My primary key in the
"mailbox" table is "id", but the alias table is just
2006 Jan 19
7
bug in has_many count?
I can submit a patch, but wanted to confirm I''m looking at this right...
The docs indicate that if you specify a has_many association with
:finder_sql, but no :counter_sql, it constructs the appropriate counter
sql by substituting the SELECT clause.
But has_many_association.rb doesn''t seem to do that -- it just passes
Base#count_by_sql the finder_sql, which doesn''t
2006 Apr 25
4
Symlinks in Capistrano?
I have a few projects with large directories (say, user-uploaded files) that
make using Capistrano a bit awkward. However, I suspect that I may have
reached the "write a custom task" level.
(I suppose I''m just thinking out loud, here...)
It seems as though I''d want this directories symlinked in /shared... Maybe
there''s a way to extend the
2005 Dec 11
4
Problem with acts_as_paranoid: "ArgumentError: Unknown key(s): group"
Here''s the full error:
1) Error:
test_add_message_to_existing_ticket(TicketTest):
ArgumentError: Unknown key(s): group
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/core_ext/hash/keys.rb:48:in
`assert_valid_keys''
/usr/lib/ruby/gems/1.8/gems/acts_as_paranoid-0.2/lib/acts_as_paranoid.rb:125:in
`validate_find_options''
2005 Dec 27
3
Trouble combining :has_many, :finder_sql and :conditions to create a sub-search
I''m sure there''s something right under my nose that I''m missing. I
have two tables with two parallel one-to-many relationships. I wish to
use the :finder_sql parameter to essentially ''or'' the two foreign
keys.
What isn''t working for me is performing a ''sub-search''.
Let''s say the tables are "stores" and
2008 Sep 12
1
ArgumentError: Unknown key(s): dependant
Hello,
I came across an association error today with facebooker.
class Cover < ActiveRecord::Base
belongs_to :album
end
class Album < ActiveRecord::Base
has_one :cover, :dependent => :destroy
end
At the console:
>> Album.find :first
ArgumentError: Unknown key(s): dependant
from
2006 Feb 28
3
[AR] #{id} namespace visibility used in finder_sql
Dears,
[Rails 1.0.0]
I''m working with a legacy schema, and around my 20+ models i''ve used
some AR constructs.
They are based on a finder_sql doing some dirty sql and using #{id}
from the ''pivot'' model for extracting data in other tables.
like :
class Division < ActiveRecord::Base
set_table_name "legacy_division"
set_primary_key
2006 Oct 30
2
It this possible: finder_sql-like behavior for belongs_to?
Guys,
I have a need to support as has_many/belongs_to relationship on a
legacy(kind of) schema. The reason I say kind of is that the schema does
have "id" columns that are used in many associations, but this particular
has_many/belongs_to association needs to support different ones.
I''ve attached to code at the end of this email. Suffice it to say I need to
use the standard
2006 Mar 10
4
problem when looping through habtm children in a view
I have this code in a view:
<% for topic in @topics %>
<%= topic.id %> <%= topic.dr_title %><br/>
<ul>
<% for doc in topic.child_documents %>
<%= doc.dr_title %><br/>
<% doc = nil %>
<% end %>
</ul>
<% end %>
Though the topic titles and IDs display correctly,
2006 Aug 15
2
has_many + finder_sql & :include
Hello,
In a model I have:
has_many :things, :finder_sql => '' select * from other_things '' +
'' where id = #{id} ''
When I do MyClass.find(:all, :include => :things) I get a weird error:
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in
2006 Jan 03
4
Set the foreign key constraint column name?
I am applying Rails to an existing schema and not sure how much the
existing developers will let me go in and rename things. So I need to
discover the limits of what I can change with Rails.
I''ve found set_table_name and set_primary_key, which have been very
useful.
If I have a "foo has_one :bar" relationship, but then in the bar table
my column is named "fooid"
2005 Dec 30
5
HABTM with finder_sql problem (Rails bug?)
I''m building an app that needs i18n support across the entire database
(i.e. localized attributes). In order to do this I''ve created a
special HABTM join table that can be associated with _any_ other
table:
create table language_strings (
for_table varchar(255) not null,
foreign_id int not null,
language_id varchar(5) not null,
attr_name varchar(255) not null,
value text
2006 Aug 04
14
Printing an Order
Can Rails be used for printing an order in a store application that has
arrived?
--
Posted via http://www.ruby-forum.com/.
2006 May 04
2
Building a FAQ
I''m new in Rails, and I''m building my first application. I''m trying to make
a FAQ for this application, organized by product (questions about each
product) and category (questions of different categories or topics), and
there is something I can''t figure it out how to do.
I have these tables:
create_table "faqs" do |t|
t.column "question",