Displaying 20 results from an estimated 700 matches similar to: "Help with ActiveRecord"
2006 Jun 27
3
Weird ActiveRecord Foreign Key Problem
Hello to all,
I ran into a weird problem with an ActivRecord. I have a table named
"build_order" with a column named "type" that is a foreign key to a
table called "building_type". In a controller I try to read all the
build_orders with "BuildOrder.find :all" and get the following error and
stack trace:
(eval):1:in `instance_eval'': compile
2006 Jun 22
11
Help please
Getting this error:
SyntaxError in CompanyController#positionslist
(eval):1:in `compute_type'': compile error
(eval):1: parse error, unexpected tINTEGER
Object::2
I could not find anything out about it (googling) and it''s not the
clearest error message. Not sure if it''s related to an expected data
type but that wouldn''t make sense. The only other thing I can
2006 Dec 14
3
Problem with ActiveRecord and Associations
Hi,
I''m having what I believe to be a typecast problem with ActiveRecord and
Associations. In the code below, I need to flag a contact record for
deletion if the contact doesn''t have any addresses or books records:
sql = "select id, delete_flag from contacts where id = #{params[:id]}"
contact = Contact.find_by_sql(sql)
if (contact[0].addresses.count +
2009 Jun 23
2
syntax error, unexpected tINTEGER, expecting $end
Please help me solve the following error message:
syntax error, unexpected tINTEGER, expecting $end
I have this model:
Code:
1. class GeoDatum < ActiveRecord::Base
2. end
The database contains the table geo_data, which contains the zip_code
column, filled with zip codes. I get the above error when searching
for a zip code and the zip code exists in the table. Here is the
2006 Jul 08
1
Need Help Understanding Situation with Table Columns
I am trying to create an application loosely based on the Depot application
presented in Agile Web Development with Rails (AWDwR). I am using InstantRails
for the server. In my app I have the folowing controllers:
admin_controller
application_controller
city_map_controller (with method: displayGMap)
The admin_controller was created with the following command:
ruby script/generate scaffold
2006 Dec 22
2
Relating Namespaced Models
I am dealing with a large project. I use a lot of STI and therfore have
a lot of models. I''d like to use namespaces to help organize my models
but am having trouble getting started.
I have a base model Term::Base located in /app/models/term/base.rb:
class Term::Base < ActiveRecord::Base
set_table_name "terms"
end
I have a non-namespaced client model:
class Client <
2006 May 11
0
Handling instantiate_without_callbacks
Hi,
I''m writing this app with inheritance. I''m using the type column to
store the class name. Another app scans the app and performs actions.
However, it is possible that the second app does not implement a
class, in which case, the superclass should be instantiated. Now I''m
getting:
/opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/
2006 May 17
10
Weird error
What does this mean?
(eval):1:in `compute_type'': compile error
(eval):1: parse error, unexpected tINTEGER
Object::0
^
Anyone know? Any help counts!
Thanks in advance,
Mohammad(Programmer-22)
--
Posted via http://www.ruby-forum.com/.
2006 Jun 06
0
Scaffolding Extension - Polimorphic Associations
When I try to use it with polimorphic associations I get the following
error
In browse action:
activesupport-1.3.1/lib/active_support/dependencies.rb:100:in
`const_missing'': uninitialized constant Privable
activerecord-1.14.2/lib/active_record/base.rb:1246:in `compute_type''
activesupport-1.3.1/lib/active_support/dependencies.rb:131:in
`const_missing''
2006 Apr 06
4
Record retrieval in Many-to-many using :through not working
Hello,
I get an error while retrieving records from the following model structure.
Tables
foods - id, food
foodallergies - food_id, symptom_id, a few other columns
symptoms - id, symptom
Models
class Food < ActiveRecord::Base
has_many :foodallergies
has_many :symptoms, :through => :foodallergies
end
class Symptom < ActiveRecord::Base
has_many :foodallergies
has_many :foods,
2006 Nov 26
5
associations help?
I have Users who can "own" Projects. There is only one owner. Users in
general can be authorized to view certain projects. Here is my initial stab
at this:
class User < ActiveRecord::Base
has_many :projects # ownership
has_many :project_viewers, :dependent => :destroy
has_many :projects, :through => :project_viewers, :uniq => true
...
end
class
2006 Jun 23
1
''Series'' Pluralization
Howdy,
I have a model I called ''content_series''. I created it and noticed that
Rails called it ''Sery'', so I added ''series'' to the uncountable thing in
the config, like this:
Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, ''\1en''
# inflect.singular /^(ox)en/i, ''\1''
#
2006 Jan 30
9
error when adding a new table to the existing application
Deniz wrote:
> Hi Everybody,
> I am a newbie in this list so please forgive me if this is a lengthy
> message.
> Currently I am working on a project at my work place that includes
> viewing some oracle tables(I do not have control over to rewrite the
> tables) and searching the tables based on a given criteria with Rails.
> Up untill now everything was working great. The
2006 Jan 27
5
Newbie:Adding a new Table-Strange Error
Hi Everybody,
I am a newbie in this list so please forgive me if this is a lengthy
message.
Currently I am working on a project at my work place that includes
viewing some oracle tables(I do not have control over to rewrite the
tables) and searching the tables based on a given criteria with Rails.
Up untill now everything was working great. The database consists of a
lot of tables but I was
2008 Oct 16
5
2 Models: Same name, different namespace => Problems
Let''s start with an example:
---
class Comment < ActiveRecord::Base
end
# dummy (to invent a "table namespace")
class Review < ActiveRecord::Base
end
# ... dummy
# is "review_comments" in the database
class Review::Comment < ActiveRecord::Base
belongs_to :thing
end
class Review::Thing < ActiveRecord::Base
has_many :comments, :class_name =>
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
I submitted this earlier, but the web forums went down and I''ve screwed up
the thread, so I''m starting over.
I''m trying to built a document upload system. The system has a main
Document model with different subclasses for different types of documents.
With the code below, if I attempt to create a Document, it works fine, but
if I attempt to use one of the subclasses, I
2005 Dec 18
7
Testing against 1.8.4
So apparently 1.8.4 is soon forthcoming. We need testing against it.
Could someone help out with that? I believe Ara already checked into
some of the issues, do you know if those are resolved, Ara?
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
http://www.basecamphq.com -- Online project management
http://www.backpackit.com -- Personal information manager
2007 May 24
3
Annoying problem, stack error
For some reason rake spec is totally crapping out on me.
I don''t know what I did to make it break, the only thing I tried new
was install haml, but even after removing it there is still a stack
trace.
Here is what I am getting-
sparta at phalanx ff $ rake spec
(in /Users/sparta/Projects/work/idastudios/ff)
2006 Apr 13
2
One model won''t work like the others, generating weird error
I''ve been banging my head against this for quite some time and can''t
figure out what is going on. I''m doing up a web site based on Typo and
adding in some custom controllers. I''m running Typo from trunk, so it''s
using the version of rails in vendor/rails. Everything is going
smoothly...until now.
I have one model that JUST. WON''T. WORK.
2006 Mar 26
4
select information from sqlite_master error
Hi,
I''m having fun playing around with Camping...I am slowly working on extending tepee to a personal e-notebook sort of tool (never lose my papers/revisions....hehe).
I''ve given tepee an oswd css design, and am currently adding a admin page that I want to show the ruby version, sqlite version and db size and db stats information.
I tried running:
@db_stats =