Displaying 20 results from an estimated 1000 matches similar to: "Nil Object Error"
2006 Jul 03
1
how to get value from the post on the List page
Hi,
I''m new to Rails. I''m building a candidates tracking system for
recruiting. I have a List page, but instead of listing every candidate,
I only wanted to list the candidates in certain statuses. The first
time List page is hit, by default, it lists candidates in status < 9.
But on the List page, there is a dropdown where all the statuses are
listed, so that when user
2007 May 05
4
Stop words, fields, StandardAnalyzer quagmire
Hello,
I''m using: Ruby 1.8.6, Rails 1.2.3, ferret 0.11.4, acts_as_ferret from
svn stable.
I''ve had quite a day wrestling with trying to remove the use of
stopwords. The problem was that when searching for words like "no" or
"the", no results were found. I found a confusing thing behavior that
has taken me some time to figure out, and I hope sharing it
2006 May 26
7
migration with required data
I''m working on a bugtracker application in rails. I have a Bug model
and I want to add a Priority to the mix. A Bug can have one priority.
I generate a Priority model, modify my Bug model with a belongs_to
:priority and create my migration like so:
class CreatePriorities < ActiveRecord::Migration
def self.up
create_table :priorities do |t|
t.column :name, :string,
2008 Nov 26
3
New status_id in Facebook API - FIX
Hi,
I''ve had one of my application broken this morning (French time) with
this error :
NoMethodError (undefined method `status_id='' for
#<Facebooker::User::Status:0x2ad52d1c8478 @message={}, @time="0">):
It appear that Facebook API had change in the status : a status_id
node is new :
<user>
<uid>785637999</uid>
2006 Jun 08
1
question about finding with :include versus nested dynamic finder (bad form? efficiency?)
I have a User model and a Status model. Each user is given a certain
status, either "Accepted", "Rejected", "OnHold", "Declined", etc. I
need to find all users with a status of "Accepted", so I''m doing the
following:
in User.rb:
belongs_to :status
def accepted_users
status_id =
2006 Aug 09
1
question about enforcing constraints in the model
I have a user model and a status model. Each user has a specific
status (accepted, rejected, declined, etc).
I have a form that allows the adminstrator to change certain options
for a user, including their status. I''m using a drop down menu
populated with the different status values, and a default option that
says "Choose a new status" with a value of "".
I want to
2006 Jan 03
1
options_from_collection_for_select - NIL Object
i am kind of desparated
i try with options_from_collection_for_select to get option values, but
it says
You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.inject
but @customers is not empty ->
def get_customer
@customers=Customer.find_all
end
i have tested it and also the attributes "id"
2006 Jan 27
1
Basic Many-to-One association
Sari,
I got the list display working without doing an explicit find.
It took a bit of a conceptual convulution to get it to work. I was
thinking of it has Many Cases have One status.
There is no support for Many-to-One so I was a bit stumped.
Then I realized you just have to turn around your thinking to say One
Status has Many Cases. Thus it is a One-to-Many relationship. That
is descriped
2006 Jan 22
2
suggest for "ambiguous column" when JOIN associated tables
Today I face with incorrect behavior in ActiveRecord.
It take place when I try to use :include parameter for .find method.
Where are two typical cases:
1. You have record with self-referential joins
CREATE TABLE keywords (id, group_id);
class Keyword < ActiveRecord::Base
belongs_to :group,
:class_name => "Keyword",
:foreign_key =>
2009 Nov 25
1
Puppet custom functions and user permissions
Puppet custom functions and user permissions
I am busy writing a custom function to automatically add OSSEC agents
to a OSSEC server after installation. Unfortunately, it seems that
puppetmasterd is not respecting the entries in /etc/group in linux. No
matter how many other groups the puppet user has been added to in /etc/
group, when puppetmasterd runs the custom function the effective/real
user
2007 Jun 20
0
WHAT happened to AgentMonitorOutgoing(c) in Asterisk 1.4.5 ??
Recently installed 1.4.5, and still unfortunate to find out that the 'c'
option in AgentMonitorOutgoing() still doesn't work ('c' - change the CDR so
that the source of the call is 'Agent/agent_id'). It wont change the source
channel column in the CDR to 'Agent/agent_id' like it used to in 1.4.2 and
other releases older than that.
I hope this gets fixed in the
2007 Jul 02
8
Strange intermittent no search results problem
Hello,
First the specs:
ruby 1.8.6, rails 1.2.3, ferret 0.11.4, mongrel 1.0.1, mongrel_cluster 0.2.1
And the model''s aaf config:
# Ferret search engine
acts_as_ferret({:fields => {:name => {:boost => 10},
:summary => {:boost => 2},
:body => {:boost => 1, :store =>
:no},
2009 Oct 04
3
Problem using ActiveRecord find with :joins and :select
Hi guys,
When I do:
temp = User.find(:all,
:joins => "INNER JOIN contents ON users.agent_id =
contents.id",
:select => "contents.id, users.id, users.u_date")
temp.first.inspect
It seems to work fine, but it only returns:
#<User id: 6, u_date: "2009-10-03 19:32:23">
but not the contents.id information.
I
2008 Apr 23
0
self referential (n-n relationship) belongs many controller
Hi all,
I ve some troubles in my small acpplication (only 2 tables).
I want to follow up tasks but these tasks are linked to others tasks.
So I ve tried to do store the nn relationship in other table called
links
1st table : tasks
columns : id | infos neutral... (as title, description etc ...)
-----------------------------------------------------------------------------------
model :
class
2006 Jun 07
2
Are the find_ methods strictly a SQL thing?
I''ve had a number of occasions now where I want to find something in my
model that is not on the primary object. For instance I''ve got a class
Alert that has_one Status. Status has a "label".
I want to find all of my Alert objects and order the results
alphabetically by status label.
Can I do that without going into SQL? Right now I find myself doing an
2006 Jan 26
3
global objects?
Forgive the term global if that''s not applicable in rails (i come from a
php background)
I have a browse controller with a couple of different methods
def method1
@properties = Property.find_all
#other stuff for that method
end
def method2
@properties = Property.find_all
#other stuff for that method
end
def method3
@properties = Property.find_all
#other stuff for that method
end
I
2006 Jul 09
8
find_all order question
How does one properly get find_all to grab the data from the DB table
ordered by a specific column?
For example:
@anglers = Angler.find_all
This code gets all the angler records and they are sorted in order of
the id field which is of course set as a primary key in the DB (mysql).
I''d really like to pull the data from the DB sorted in the order of
another field, for example
2010 Apr 07
3
Recommendation for searching with regards to timestamp & foreign key attributes
hi guys,
I need a recommendation for searching with regards to timestamp &
foreign key attributes. Sounds
a bit too much but here''s an example.
Suppose we have a "blog" object. It has many attributes such as
- title
- content
- status_id
- created_at
- updated_at
There are also "status" objects which have the following statuses,
"new",
2006 Nov 28
0
tzinfo_timezone/tzinfo can't modify frozen object
Hi.
I get the following error off and on in my app. I''m running latest
EdgeRails in development mode, and use the tzinfo_timezone plugin and
the tzinfo 0.3.3 gem.
I''ve checked line 210 in tzinfo_timezone.rb but cannot relate that to
an object modification in tzinfo. Any tips much appreciated.
ActionView::TemplateError (can''t modify frozen object) on line #29 of
2006 Jan 13
4
Single Table Inheritance (this is my 3rd post :( )
Hi Everyone,
I hope I get some feedback on my question. Here it goes.
I have a situation here, I have a company table and then using Single
Table inheritance it is of 3 types:
class Company < ActiveRecord::Base
end
class Vendor < Company
end
class Customer < Company
end
class Agent < Company
end
Now I have a active record Association
class QuoteSheet < ActiveRecord::Base