Displaying 5 results from an estimated 5 matches for "title_id".
2008 Sep 18
1
"xxx_id may not be null" when saving many to many joined objects
...In my TunesController I create a new Tune, Variation and Title. I set the
:tune and :title attributes in the Variation, and add the Variation to the
tune and title''s :variations arrays.
The problem is that when I save the Tune, I get the following error:
SQLite3::SQLException: variations.title_id may not be NULL:
INSERT INTO "variations" ("updated_at", "title_id", "tune_id", "created_at")
VALUES(''2008-09-18 12:21:52'', NULL, NULL, ''2008-09-18 12:21:52'')
I assumed that Rails would know that the Tune, Vari...
2006 Feb 27
4
prepared query with RODBC ?
Dear List,
Would anyone know how to perform prepared queries with ROBC ?
I had a shot with some of the internal (non-exported) functions of the package
but ended up with a segfault, so I prefer asking around before
experimenting further...
Thanks,
Laurent
2006 Apr 12
0
Looking for a simpler model using :through associations
...ctiveRecord::Base
has_many :roles, :dependent => :destroy
has_many :groups, :through => :roles
end
class Group < ActiveRecord::Base
has_many :roles, :dependent => :destroy
has_many :users, :through => :roles
end
#The roles table has columns (id, user_id, group_id, title_id)
class Role < ActiveRecord::Base
:belongs_to :user
:belongs_to :group
:has_one :title
end
class Title < ActiveRecord::Base
:belongs_to :role
end
A typical use case is to find the owner of a given group, or more
generally, find users with a given title in a given group. This c...
2008 Jul 20
10
STI and fixtures
...belongs_to :address
end
fixtures for people
Nicolas:
first_name: Nicolas
type: Employee
reports_to: david
David:
first_name: David
type: Manager
after loading the fixtures, in the console
>> e=Employee.find(:first)
=> #<Employee id: 5038945, type: "Employee", title_id: nil, first_name:
"Nicolas", reports_to: 0, created_at: "2008-07-20 18:33:49", updated_at:
"2008-07-20 18:33:49">
>> e.reports_to
=> 0
Loading fixtures doens''t seems to associate my 2 objects, do know what''s
wrong ?
--
Posted via http:/...
2011 Sep 15
2
Dragonfly and Zip uploads
I''m poring through the Dragonfly source code right now, trying to get a handle on how to apply the following technique there:
Client uploads a Zip archive containing N images, PDF files, text files, etc. When that file arrives at the server, but before it is stored as an attachment to the current object, the Zip is burst open, contents are iterated over, and each contained file is saved