Displaying 20 results from an estimated 120 matches similar to: "using two foreign keys to the same table"
2006 Jun 27
2
how to use scope with acts_as_list
i am working on a task management system for the company i work for. i
just got the rails cookbook and am trying to use the section on creating
a drag and drop sortable list.
the tricky part is that my Task model references the User model in two
different spots. i have one field for the creator of the task and
another for the assignee. so in my Task model i have the following code:
class
2006 Mar 24
1
Problems with before_validation
Hi all
My visitors can create party organisator profiles, and I want assign
them as the creators (the field creator_id in the organisators table
references a member in the members table).
To do that I tried it with before_validation:
def before_validation
creator = Member.find 1
end
Sadly, this does not work. The validation
validates_presence_of :creator_id
Still tells me, that
2006 Jan 20
11
Userstamp Plugin
I''m pleased to announce a new plugin for Rails: Userstamp. You can read my
blog post at http://www.delynnberry.com/articles/2006/01/20/userstamp-plugin
and/or read all about it at the perminant page
http://www.delynnberry.com/pages/userstamp. Any comments or suggestions for
improvement are much appreciated.
--
DeLynn Berry
delynn@gmail.com
http://www.delynnberry.com
A dump of the Readme
2006 Jul 13
5
how to get to the parent of a child object.
Hi, i have a problem with the following:
I have an application with patients <-->>consults
models are ok
in the view list_consults i do this:
for consult in @consults%>
<tr>
<td><%= consult.patient.name %></td>
<td><%= consult.reason %></td>
<td><%= consult.date %></td>
<td><%= link_to
2013 Oct 06
17
AMD IOMMU disabled - No Perdev Intremap
Hi!
From other people posting to this list, I know that there has been a
bug related to the issue described in Xen Security Advisory 36 that
disables iommu for some AMD users like me.
However, even when passing "iommu=no-amd-iommu-perdev-intremap" it
still disables i/o virtualisatoin. Related Xen dmesg output:
(XEN) IVHD Error: Invalid IO-APIC 0
(XEN) AMD-Vi: Error initialization
2013 Mar 12
5
XSA-36 / howto fix broken IVRS ACPI table
Hello,
since applying the patches related to XSA-36 Xen recognizes a broken IVRS ACPI
table and disables I/O virtualisation.
I contacted the manufacturer of the mainboard/BIOS and they want to help me by
providing a patched BIOS - so far so good.
However, they need details about what to fix, which I don''t know either.
Could you pls. give me some hints which I can forward to the
2005 Mar 01
0
has_and_belongs_to_many problem
I''m having a problem with a has_and_belongs_to_many (habtm)
association between two models with extra attributes. I''m writing a
comic book database, and each issue has many creators on it. Thing
is, some creators perform multiple duties. They may write one issue,
draw another, etc.
However, if I add a creator twice to an issue and try to delete it, it
removes both creators:
2006 Jul 14
3
Migration not updating fields
So I have this fairly basic migration bit of code
class AddCounterCache < ActiveRecord::Migration
def self.up
add_column ''products'', ''backlog_items_count'', :integer, :default =>
0
end
def self.down
remove_column ''products'', ''backlog_items_count''
end
end
What I want to do in that is automatically
2008 Aug 24
1
avoiding exceptions in views
when rendering a view, if the object being rendered doesn''t respond to a
method it raises an error message.
For example, I have an Employee class and each employee has many Tasks.
So I may call:
<%= employee.tasks.first.task_name %>
If, for some reason an employee has 0 tasks associated with it, the
above template method would raise an exception.
Is it efficient to loop through the
2004 Apr 02
2
Futzing with TaskScheduler
Hi all,
Thought I should say something - it''s been a little while. :)
Anyway, I''m still futzing with how I want the Ruby API to look. The more I
look at the Perl version, the more I think it was too faithful to the C API.
Right now I''m looking at the trigger() method. For example, I don''t see
any reason to make the "type" key take a hash as an
2005 Dec 30
1
Need serious help - unit testing without a database
I''ve created a model, let''s just call it Person
class Person
attr_accessor :first_name, :lastname
def full_name
@first_name + " " + @last_name
end
end
I''m using this in my Rails application. My Rails application does not
use a database of any kind, and this model is obviously not a subclass
of ActiveRecord::Base. I can''t unit test this
2008 Feb 21
4
undefined method `save' for :Array
hi all
when i m trying to save my tags.this error s cmng........cn anybody
help me to how to save the array
error depicting = undefined method `save'' for []:Array
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2018 Jan 24
1
Help with SQLsave
Hi all,
I'm using RODBC library to connect to a database.
I'm trying to read a table from a database and after manipulating it would like to write to the same database but with a different table
P<-data.frame(sqlQuery(myconn,'select? *? from Demographics'))
sqlSave(myconn,p,tablename="trial",rownames=FALSE)
I'm gettng this error
Version:1.0
2015 Sep 06
1
Monthly posting
Hi,
What text should be in monthly posting to this mailingist, the Syslinux mailinglist?
Things I have in mind:
* That gettng a wiki account is in two phase, first create a wiki account,
then tell the accountname so it gets write permission
* our Roadmap (currently: BIOS works, UEFI is work in progress )
* Download locations and git repositories.
* Answers to Frequently Asked Questions.
2006 May 02
4
How to extend rails rake tasks?
Does anyone know how to extend the buit-in rake tasks like test:unit.
I want to custom load some fixtures in a particular order.
Thanks,
Zack
2007 Aug 23
3
recording current_user
Hi,
Another noob here I am afraid! I have a questuin about the current_user
method that comes with AAA.
I have AAA set up and working fine and if i put <%=
self.current_user.login %> into a view it shows the login name as
expected on the page.
What I cant work out is how to record this into the database when the
user completes a form.
My app so far only has two models.
2006 Jul 02
2
Problems implementing a N:M table that contains actual data
Hi everyone,
I''m currently finishing the planning phase of a small project I want to
create. I read a bunch of tutorials about ActiveRecord and the
different way to link your "tables" with belongs_to, has_many,
has_and_belong_..., etc... However I''m stillnot sure if what I''m trying
to do will work *well* with ActiveRecord.
So enough talk,
2006 Jun 20
0
habtm has_many through and foreign keys
I have two models
Role and Task
..and a join table/model RoleTask
Now both roles and tasks have id as a primary key and name which is a
unique identifier
I want the join table to hold role_id and task_name
I''ve tried using habtm with foreign key and association foreign keys set
up and I''ve tried using has_many :through
..but they all seem to someone want to work with the
2006 Apr 06
3
sortable list not saving to database
i am trying to use a sortable list on my app. i used the chapter in
Rails recipes as a reference on how to do it. i have the following code
in my controllerr:
def sort
@user_list = User.find(params[:id])
@user_list.tasks.each do |task|
task.position = params[''user-list''].index(task.id) + 1
task.save
end
render :nothing => true
end
and in my
2006 Apr 07
1
changing visual_effect defaults
what is the correct syntax for changing an effect like :highlight? i
tried looking through the api, and found it, but i can''t seem to get it
right.
i want to change the start color of visual_effect(:highlight,
''user-list''). i tried visual_effect(:highlight, ''user-list'', :startcolor
= ''#990000'') and several other variations of