Displaying 20 results from an estimated 100 matches similar to: "Frozen hash problem"
2010 Mar 24
3
More elegant solution for "missing" has-many through ids?
I have LabGroup and LabDesc which have many through LabDescGroup. I''d
like to identify LabDescs which don''t have a LabGroup. This works:
x = []
LabDescGroup.find( :all, :select => ''DISTINCT lab_desc_id'' ).each{ |c|
x << c.lab_desc_id }
y = []
LabDesc.find( :all, :select => ''id'' ).each{ |c| y << c.id }
notfound = x - y
But
2008 Jan 12
1
Collection_Select not showing Selected option
Hi, I''m having some problem with getting collection_select to return
the current value when editing a record. According to everything I''ve
seen, there was an issue but it''s been fixed, but I can''t figure out
why it isn''t returning the current value as a selected option. I''ve
checked the table structures, and both the call_driver.product_line_id
2013 Mar 21
0
how to remove changed_attributes from yaml response
Hi,
I am using attr_accessor attributes in model class and assigning the
values to attr_accessor dynamically in controller. And am sending the
data object to display in Yaml format. I am getting the response along
with changed_attributes but I don''t want changed_attributes details in
my response.
build Model code
class Test < ActiveRecord::Base
attr_accessor: t_1, t_2, t_3, t_4
end
2006 Sep 04
2
"include" versus "extend" - what's the difference
Hi,
Just wondering when one would use "include" over "extend"? Both seem to
bring in methods to the class no?
The context is I''m just trying to understand why both are used with the
acts_as_audited plugin:
Full extract from plugin (used within here):
==================================================
# Copyright (c) 2006 Brandon Keepers
#
# Permission is hereby
2009 Aug 28
0
Nil object nightmare
I''m having a real problem with nil objects in a view I''m playing with.
if I type ...
<%= debug lesson.lesson_register.attendees %>
I get the following displayed in the browser ....
- !ruby/object:Attendee
attributes:
enrollee_id: "25"
created_at: 2009-08-27 15:10:41
updated_at: 2009-08-27 15:10:41
id: "1"
attended: f
2006 May 17
0
acts_as_versioned with lock_version bug?
Hello.
The acts_as_versioned plugin works fine ... till the adjunction
of optimistic locking via the lock_version table column.
Here is the problem description:
Without optimistic locking things are fine:
# ++++ The table creation migration ++++
% cat db/migrate/001_create_tables.rb
class CreateTables < ActiveRecord::Migration
def self.up
create_table :softwares,
2010 Jan 11
1
Help with Order
Dear List
As a fairly new R programmer I seem to have run into a strange problem -
probably my inexperience with R
After reading and merging successive files into a single data frame, I find
that order does not sort the data as expected.
I have multiple references in each file but each file refers to measurement
data obtained at a different time.
Here's the code
library(reshape)
#
2010 Feb 01
1
Comparing Variables and Writing a New Column
HI,
I am using Windows XP and R version 2.9.2. I have a data frame written by R
similar to the following:
Lab_ID Analysis_Soil Results -4MAD -2.5MAD
+2.5MAD +4MAD
55003 Calcium-2008-116 900 961 1121.5
1656.5 1817
55003 Calcium-2008-117 3321 2175 2380.5
3065.5 3271
55003
2008 Sep 08
0
Share access on new server
I am new to the Samba world and need to port the Samba setup from an old server running BEL Server (RedHat under the hood) with Samba 3.0.25 to a RedHat EL 5.2 server with Samba 3.0.28, but some of the share access is not working.
After copying over the smb.conf file I ran testparm and had issues with the oplocks so I commented out the entries referring to oplocks (also the docs indicated that
2009 Sep 24
8
Drop down list ?
Hi Gurus, I''m trying to tackle a drop down list. I have category and
item dbs, and they''re wired up with category has_many :items and item
belongs_to :category, and an item has a category_id. I have this code
in my new/edit.html.erb for item:
<%= f.collection_select :category_id,
Category.find_main, :id, :header, {}, :multiple => false %>
And a pretty drop down list
2005 Jun 23
1
Stop Warnings for Invalid Factor Level, NAs generated?
How can I stop the following warning from occuring?
invalid factor level, NAs generated in: "[<-.factor"(`*tmp*`, iseq, value =
structure(1, .Label = "12", class = "factor"))
The Label messages are for "5", "8", "12" and "46". I want the NAs to be
generated as needed.
Is this causing R to slow down by generating the warning
2005 Jun 09
2
Weibull survival modeling with covariate
I was wondering if someone familiar
with survival analysis can help me with
the following.
I would like to fit a Weibull curve,
that may be dependent on a covariate,
my dataframe "labdata" that has the
fields "cov", "time", and "censor". Do
I do the following?
wieb<-survreg(Surv(labdata$time,
labadata$censor)~labdata$cov,
2010 Oct 11
5
Object lost in memory/trashed?
Hi,
I''ve got a problem on which I''ve spent many hours, and I can''t get a
clue on what is happening... I hope someone here will be able to help
me.
Here is the situation : my Rails app uses acts_as_commentable and
acts_as_bookmarkable on a Diagram model. Everything''s working OK
individually: I can create a comment on a Diagram, bookmark it, and so
on.
Now,
2010 Jun 08
9
[Rails Heroku] Problem with saving object (on heroku hosting)
Hi All,
I have some strange problem which appears only on heroku hosting 2.3.5
default stack (not on my local computer)
I have some models. Here they are:
class Contact < ActiveRecord::Base
belongs_to :user
belongs_to :type, :class_name => "ContactType", :foreign_key =>
"type_id"
validates_presence_of :name, :on => :create, :message =>
2010 Apr 01
6
Rails model design visualization
I''m a fairly visual person, and I have a piece of paper with many
boxes and arrows with labels like "has many" and "belongs to" for my
database models. It''s messy, but it works.
What I keep looking for--weeks, actually, I''m certain it''s out there,
but I haven''t hit on the right set of Google query terms :)--is
something that will
2006 Dec 28
0
RODBC not working when connecting to a Sybase database
What is this error message about and how do I troubleshoot it?
> sqlTables(channel)
Error in .Call("RODBCFetchRows", attr(channel, "handle_ptr"), max, buffsize, :
negative length vectors are not allowed
The channel was created as such
channel <- odbcConnect("Labdata")
I think this is telling me that my odbcConnect command worked
>
2009 Sep 25
12
uniqueness validation perplexity
I want to write a validate routine to check to enforce that a position
must be unique in a category. (In another category, it doesn''t have
to and shouldn''t need to be unique.) I write this code which works
happily for new items:
def position_in_category_not_unique
@items = Item.find( :all, :conditions => [ "category_id = ? AND
position = ?", category_id,
2009 Mar 08
1
re shaping a data frame with multiple IDs
Dear R-experts,
I have the following "long" data frame:
ID <-
2002 Mar 12
1
RArcInfo Package, get.bnddata()
I am having trouble using get.bnddata() in the RArcInfo package. I
installed the version 0.2 binary of the package for Windows and am using R
1.4.1 on Windows NT 4.0. I have had no problems importing and plotting arc
data with get.arcdata() and plotarc(). plotpal() also works fine. I've
been able to use get.arcdata(), get.labdata(), get.paldata(),
get.tablenames(), get.tablefields(),
2009 Aug 26
5
Noob DRY method question
Hi Gurus, I''m learning the Rails framework, and I have this exact
block of html/javascript in two places in an if/else construct in
application.html.erb:
<body onload="Modalbox.show(''<div class=\''warning\''> <p> <center> <%=
flash[ :notice ] %> </center> </p> <p> <center> <input