Displaying 3 results from an estimated 3 matches for "find_sql".
2006 Jun 27
3
Weird ActiveRecord Foreign Key Problem
....2/lib/active_record/base.rb:924:in
`find_every''
c:/programme/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:381:in
`find''
#{RAILS_ROOT}/app/controllers/building_controller.rb:14:in `index''
If I replace the "find :all" with an "find_sql" where I read all the
columns except the "type" column, the error doesn''t occur. The type of
the column is "type INTEGER UNSIGNED NOT NULL". Is there anyone who have
an idea what I might making wrong here?
Thanks in advance and best regards
Torsten
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 Aug 18
9
Rails is doing what I want - but I don''t understand how.
Hi guys, I have the strangest thing happening. The funny part is its
doing exactly what I want to do, I just don''t understand how.
Basically here is my model.
class Role < ActiveRecord::Base
has_and_belongs_to_many :users
has_and_belongs_to_many :rights
def self.names
names = Array.new()
for role in Role.find :all
names << role.name
end
return