Displaying 20 results from an estimated 100 matches similar to: "ActiveRecord::Base.transaction - SystemStackError - stack level too deep:"
2005 Apr 20
2
Has And Belongs To Many Validations
Here is the schema that I am working with:
courses -> courses_teachers <- teachers
I want to ensure that a teacher is not assigned the same course more
than once. In other words, if I''m in the courses_teachers table as
teaching Spanish 101, if someone tries to add that same teacher/course
combination to the table again, it will not be allowed.
I thought I could use something
2010 Apr 20
5
Spring Cleaning
Right now in my view, I have a whole HUGE clump of
<% if current_user %> and then <% if current_admin %> and then <% if
current_teacher %> and then all that other stuff in my view.
I have a ginourmous chunk of if and else statements in my views... is
there a way to make it prettier? The if and else''s almost all have the
same functions, expect for some minor changes.
2006 Feb 21
4
Select error
This code:
<p>
<label for="resource_type">Type</label><br/>
<%= select(:resource, :type, %w{ Web Data }, { :include_blank => true
}) %>
</p>
Produces this error:
TypeError in Resources#new
Showing app/views/resources/_form.rhtml where line #6 raised:
wrong argument type String (expected Module)
Extracted source (around line
2006 Jan 03
1
RequireResourceHelper for JS and CSS
The following was posted on my blog at http://blog.inquirylabs.com.
A friend of mine recently expressed interest in this code snippet, so
I thought I''d send it out to anyone else who''s interested. This
module makes it a lot easier to ''require'' javascript and cascading
stylesheet dependencies inside your views or controllers. By
2009 May 22
1
[PATCH server] fixed smart pool 'save' regression.
The recent refactoring didn't work properly for new smart pools, so I've cleaned jup the parameter handling for the various pool 'create' actions.
Signed-off-by: Scott Seago <sseago at redhat.com>
---
src/app/controllers/hardware_controller.rb | 5 +----
src/app/controllers/pool_controller.rb | 6 ++++--
src/app/controllers/resources_controller.rb | 6
2007 Dec 04
5
when to save, session reflect saves?
I am trying to clean up unnecessary lines (even as I hack my way forward
adding more garbage)
I have two questions on lines I have trying to keep the database and
session info reflecting changes:
def associate_pupil_to_teacher
@teacher = session[:teacher]
@pupil = Pupil.find(params[:id])
@teacher.pupils << @pupil
@teacher.save #Q1
session[:teacher] = @teacher #Q2
end
#Q1 do i
2012 Jul 12
15
How can I list classes available on the puppet master?
Is there a way to get a list of all the classes available from the puppet
master?
I have 2 goals for this - one is documentation in a human readable form,
and the other is potentially importing that data into dashboard.
I did find some info on the rest API
(http://docs.puppetlabs.com/guides/rest_api.html#resource-types ) but I
can''t make any sense of the output from it.
Thanks.
2016 Apr 11
1
[PATCH] RFC: php: support PHP 7
Adapt to the API changes in the newer versions of the Zend framework, in
particular regarding:
- strings handling
- resources handling (used for the guestfs_h pointer)
- iterating in hash maps
- data types for function arguments
Introduce helper macros to reduce greatly the amount of #if's all around
the generated C code.
---
generator/php.ml | 96
2013 Feb 22
6
Finding a manifest full file name (with path) in a function?
I''m trying to create a function that I can call in a manifest like this:
$doc = doc(''apache::service'')
In the function, I want it to actually find the filename for the
''apache::service'' class... from there, I''m going to run some code that will
generate the puppet-doc in text format, and then return it in a variable.
Ultimately this is so
2013 Nov 26
37
get a *structured* version of the puppet agent output
puppet agent --verbose shows a verbose output of the changes done by
puppet, such as:
notice:
/Stage[main]/Logstash::Config/Logstash::Configdir[agent]/File[/etc/logstash/agent/config]/owner:
owner changed ''root'' to ''logstash''
notice: /Stage[main]/Varnish/Service[varnish]/ensure: ensure changed
''stopped'' to ''running''
2007 Feb 28
8
Export/save csv-file to desktop of user?
Hi,
looking for something that simple, but can''t find it. I got:
outfile = File.open(''teams.txt'', ''wb'')
CSV::Writer.generate(outfile) do |csv|
for team in @teams
csv << [team.id, team.name]
end
end
outfile.close
send_file "teams.txt", :filename => "teams.txt",:disposition =>
2009 Feb 27
3
Making tapply code more efficient
Previously, I posed the question pasted down below to the list and
received some very helpful responses. While the code suggestions
provided in response indeed work, they seem to only work with *very*
small data sets and so I wanted to follow up and see if anyone had ideas
for better efficiency. I was quite embarrased on this as our SAS
programmers cranked out programs that did this in the blink
2006 Mar 02
5
Two foreign keys on the same column?
Let''s say I have three hypothetical MySQL tables:
? people, with columns id, gender, and source_id
belongs_to :boys and :girls
? boys, with columns id and name
has_many :people
? girls, with columns id and name
has_many :people
The gender column in people specifies which of the two source tables the
source_id refers to. For example, if we have values:
1, boy, 1
in people,
2012 Nov 05
25
[PATCH] IOMMU: don't disable bus mastering on faults for devices used by Xen or Dom0
Under the assumption that in these cases recurring faults aren''t a
security issue and it can be expected that the drivers there are going
to try to take care of the problem.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -625,6 +625,18 @@ static void parse_event_log_entry(struct
2008 Feb 11
0
Problem in passing params
Hi,
I have a controller called students_controller.rb
From a view file i am calling the index method by the URL like,
students_path(:format => :json)
I have no problem in that. But i want to pass the teacher_id as the
parameter. Like,
students_path(:format => :json, :teacher_id => 5)
The problem here is, the parameter is passing as,
"amp;teacher_id" => "5"
I
2013 Jan 29
7
stuck installing puppet in RHEL 5
Hi All,
Im trying to install but with no luck. Any idea what I did wrong ?
** mkdir -p /var/log/pe-console-auth
** touch /var/log/pe-console-auth/cas.log
** touch /var/log/pe-console-auth/auth.log
** chmod 770 /var/log/pe-console-auth
** chmod 660 /var/log/pe-console-auth/auth.log
** touch /var/log/pe-console-auth/cas_client.log
** chmod 660 /var/log/pe-console-auth/cas_client.log
** chown -R
2006 Aug 15
2
How to access attribute in a self-referential many-to-many relationship
Hello List,
I created a self-referential many-to-many relationship (as described
in the book Rails recipe #18), where I have a model that has
many-to-many relationships with itself. In this case, it''s person who
can become friends. The join table looks like this:
mysql> select * from friends_people;
+-----------+-----------+-----------+
| person_id | friend_id | confirmed |
2008 Sep 26
1
Problem with authentication... Acts As Authenticated
Hello,
I am working on the API of our webservice. API users need to
authenticate some of their calls...
When I am performig the call through Firefox, everything is fine as
shown in the log :
Processing OwnershipsController#new (for 67.207.118.174 at 2008-09-26
16:20:03) [GET]
Session ID:
BAh7BiIKKmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo
2006 Dec 21
1
need some guidance with a test
This is part of a rails project. The following method is part of the Ams
class (a rails model). I''m a bit unsure of the rspec/bdd way of testing this
method.
def persist_as_domains
@current_domains.each do |d|
dom = Domain.new
dom.domain = d
dom.source_id = 1
dom.at = Time.now
dom.save
end
end
The following is what came out when I tried to write my test. Notice
2006 Feb 22
2
Select menu validation
Is there a trick to validating select menus? I have this rule:
validates_presence_of :title, :type
:title is a text box and validates correctly but :type doesn''t:
<p>
<label for="resource_type">Type</label><br/>
<select name="resource[type]" id="resource_type">
<option value=""