Displaying 20 results from an estimated 1000 matches similar to: "Has And Belongs To Many Validations"
2013 Jun 22
4
ActiveRecord::Base.transaction - SystemStackError - stack level too deep:
Im having an issue that seems to only happen when trying to use a
transaction. Ive used transactions many times in the past and Im at a loss
as to why im getting the stack level too deep problem.
SystemStackError - stack level too deep:
actionpack (3.2.13) lib/action_dispatch/middleware/reloader.rb:70:in `''
I have a StackOveflow with more detail -
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
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
I still want to get this into Rails for all connection adaptors, but
for now I''ve hacked my own addition on for just PostgreSQL.
The following code extends every Column object returned by
MyModel.columns to support a new #required? method, which indicates if
the column may or may not be null.
The following is a huge hack - suggestions on a cleaner way to add this
functionality
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 Jan 22
2
Relationship not working
Hi all
I''m in the process of trying to make my first project on Rails after
doing the tutorial in AWDR. I picked a project which I thought would be
easy as I already have the PHP/MySQL implementation. Unfortunately I''ve
now hit a snag and was wondering if you could help?
I have a table called "races" and a table called "courses". The
relationship is:
2016 Jun 23
2
Samba pid in uninterruptible state
Greetings,
I recently upgraded Samba on an Ubuntu 14.04.2 server from version 4.1.9 to 4.2.3. Upon rebooting Samba process goes into a running state then after a short time it will go into an uninterruptible state. If I check the log.samba, it appears that it is attempting to start, then hangs at the following:
[2016/06/23 15:16:00.329503, 3] ../source4/param/share.c:124(share_register)
2007 Dec 02
3
Better way for select list for belongs_to?
I''m currently doing all of this just to have a drop-down list of
Courses for a particular student:
===== edit template =====
<%= f.select :course, @courses, :selected => @student.course.id %>
===================
===== students controller =====
def edit
@student = Student.find(params[:id])
@page_title = "Edit #{@student.full_name}"
@courses =
2016 Jul 28
3
DomainDnsZones inbound replication issue
Greetings,
I am having a problem with one of my DCs (DC3) replicating DomainDnsZones. On DC3 replication is successful on both Inbound and Outbound with both of my other DCs. On both of my other DCs (DC1 & DC2) I only get a failure with Inbound replication for DomainDnsZones from DC3 with a result 8442 (WERR_DS_DRA_INTERNAL_ERROR).
If I try to force replication to DC3 from DC1 using
2006 Oct 31
4
Auto-increment lost during migration.
Hi. I get some strange results when using rename_column on a primary
key in a migration. It seems like the migration script removes the
auto-increment property if you rename a column.
This is a minimal example.
create_table :foo, :primary_key => :foo_id do |t|
t.column "name", :string
end
# renaming the primary key makes auto-increment disappear.
rename_column
2006 Apr 20
4
Question about Associations
Hi all. Got a stupid-simple question about associations. I have two
models - school and course. There are a fixed number of schools (set
up in the migration). Each course is assigned a school and a school
will be associated with multiple courses...
How do I set up the associations? Do (can) I have School :has_one
:course and Course :has_many :schools?
Does the schools table then get a course_id
2015 Apr 16
3
Samba process pegging CPU
Greetings,
I'm currently experiencing an issue with two of my three Samba servers where one Samba process is pegging the CPU usage and eating up a lot of virtual and resident memory. While this is happening I get a "ERROR(runtime): DsReplicaGetInfo of type 0 failed - (-1073610723, 'NT_STATUS_RPC_PROTOCOL_ERROR')" error when I try to run the samba-tool drs showrepl command.
2013 Apr 02
4
gmaps4rails: undefined method `model_name' for NilClass:Class
Hi All,
just in a spot of bother with this gem, I am trying to create a new
location and get the above msg.
here is my controller:
class LocationsController < ApplicationController
# GET /locations
# GET /locations.json
def index
@locations = Location.all
@json = Location.all.to_gmaps4rails
end
respond_to do |format|
format.html # index.html.erb
2015 Apr 16
2
Samba process pegging CPU
On Thu, Apr 16, 2015 at 02:33:20PM +0000, Donaldson Jeff wrote:
> My apologies, went to paste and accidentally sent the message...see below for rest of detail.
>
>
> Greetings,
>
>
> I'm currently experiencing an issue with two of my three Samba servers where one Samba process is pegging the CPU usage and eating up a lot of virtual and resident memory. While this is
2016 Jul 28
1
DomainDnsZones inbound replication issue
Here's my edited smb.conf and the output of the testparm. As you can see I'm not setting that in my smb.conf and it appears to be turned on by default in Samba 4.4.4. I was going to update Samba on DC1 to 4.4.4 as well, but haven't done that yet. It's currently on 4.2.3. Should I upgrade that as well before changing anything else? Thanks!
Jeff Donaldson
Technology Director
Newark
2006 May 23
4
''key not found'' problem with saving model object.
Hello,
I have the following structure:
model foo
has_many :bars:,
:dependent => true
end
model bar
belongs_to :foo
end
In my action, when i try to save foo:
def save
begin
f = foo.new
f.a = 5
begin
b = bar.new
b.a = 10
f.bars << b
rescue Exception => exc
...
end
f.save! <-- This does not happen
2006 May 16
4
question about strftime when called from partial.
Hi,
I''m calling a helper I''ve written - format_time() that is called from my
views with a given time that was selected from my database and was returned
to the view via an instance variable. When I call format_time from a
partial, I see that I get some kind of String error and the partial won''t
render. Basically, the object being passed in to format_time is already a
2015 Jul 15
1
Samba-Tool Error
Greetings,
A little while ago I started receiving an error any time I tried to run a samba-tool command on my pdc. My bdc is showing inbound and outbound working just fine with the pdc. The error I am receiving is ldb: unable to stat module /usr/lib/x86_64-linux-gnu/samba/ldb : No such file or directory.
Is this just as simple as creating a soft link to /usr/local/samba/lib/ldb?
Any advice
2015 Jul 13
2
Crear datos aleatorios con restriciones
Hola,
Esta pregunta la hice en stackoverflow
<http://stackoverflow.com/questions/31137940/randomly-assign-teachers-to-classrooms-imposing-restrictions/31143808#31143808>pero
nadie pudo contestarla.
1. Quiero generar N escuelas, con G grados y C divisiones.
2. Quiero asignar cada uno de T maestros a 2 divisiones en un grado y
escuela
Si tengo C=4 divisiones, puedo lograr lo que quiero con
2015 Jul 13
2
Crear datos aleatorios con restriciones
Hola,
0. La falta de 'elegancia' hace que sea mas dificil hacer cambios al
codigo. Por ejemplo cambiar n.classrooms <- 4 a n.classrooms <- 20
1. Cuando tengo solo 4 puedo hacer esto:
schoolGrade$A <- Teachers$Teacher.ID[1:cuttoff1]
schoolGrade$B <- Teachers$Teacher.ID[1:cuttoff1]
schoolGrade$C <- Teachers$Teacher.ID[(cuttoff1+1):n.teachers]
schoolGrade$D <-
2015 Jul 13
2
Crear datos aleatorios con restriciones
Gracias Carlos,
Tu codigo es un gran paso en el sentido correcto pero no produce
exactamente lo que estoy buscando.
Mi "solucion" en stackoverflow
<http://stackoverflow.com/questions/31137940/randomly-assign-teachers-to-classrooms-imposing-restrictions/31143808#31143808>
produce un data frame `schoolGrade` con 240 observaciones y 7 variables. Mi
objetivo es poder generar un data