Displaying 12 results from an estimated 12 matches for "n00by".
Did you mean:
n00bs
2006 Apr 06
5
Using helper method of another model
I have a template that belongs to a certain model (model A). I need to
call a helper method of a different model (model B). Then I need the
helper method of B to call a helper method of model C.
I tried using "include" and "require" and using namespaces, but I got
"undefined method". What is the way to do it?
--
Posted via http://www.ruby-forum.com/.
2005 Dec 23
6
Save using Update
Hi,
I want to update an existing row in table "items" where items.id == 10
I tried this:
item = Item.new
item.f1 = ...
item.f2 = ...
...
item.id = 10
item.save
I got an error
Duplicate entry ... for key 10 : INSERT INTO items ...
How do I make item.save to use UPDATE instead of INSERT?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 22
11
ActiveRecord find
Suppose I have three tables - authors, posts and topics.
Every post have a topic and every topic has an author, so I have
posts.topic_id and topic.author_id. When the author is guest (not
registered), author_id is nil.
I need to find all the posts (in one query) where every post have all
the information of the topic and the auther, so if p is one of those
posts I could get the name of the
2006 Apr 11
4
Two versions of Rails on one PC
I want to have Rails 1.1 + Rails 1.0 on the same PC and be able to load
my script with a different version each time. Is it possible?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 03
4
in-memory test database -- where''s the schema?
I''m trying to get the unit testing for a new project to use the wonderful
:memory: database specification for SQLite. However, like many people
before me, I can''t get the schema to import or have anything else useful.
Initially, the error I get is:
/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.1.0/lib/sqlite3/errors.rb:94:in
`check'': cannot rollback - no transaction is
2006 Jan 29
1
Accessing attributes
I have a name of an attribute and I need to get its value and set a new
value for it:
x1 = a.foo
a.foo = x2
How do I do that if the name of the attribute ''foo'' is a var?
I thought about doing this:
attribute_name = ''foo''
x1 = a.attributes[attribute_name]
a.attributes[attribute_name] = x2
but this is a bypass and I''m quite sure it would cause
2011 Mar 11
12
A file-upload suddenly seems to be nil
Hi there,
I posted this issue
<https://groups.google.com/forum/?hl=de#!topic/carrierwave/ergk9LaO68k>at
the carrierwave-group, but I''m beginning to think this rather is a
rails-issue than a problem with carrierwave. The problem''s this:
I have 2 models, ''article'' and ''upload''. article has_many :uploads. In my
article_controller i
2019 Nov 18
30
RFC: Moving toward Discord and Discourse for LLVM's discussions
Hello everyone,
*Short version:*I've set up an LLVM Discord server for real time chat
(similar to IRC) and an LLVM Discourse server for forums (similar to email
lists):
https://discord.gg/xS7Z362
https://llvm.discourse.group/
Please join and use these new services. They are only partially set up and
still very new, so don't hesitate to improve them and/or reach out to this
thread with
2006 May 10
0
Boolean attributes - not so simple as I thought
Suppose I have a table ''items'' with the attribute ''bool'' which is
boolean.
There''s an array @attribs which holds :bool and some other symbols of
attributes which are not boolean.
class Item < ActiveRecord::Base
{
def attribs
[:bool , :x , :y]
end
}
The trouble is that @item.bool? and @item.bool behave differently.
If I set @item.bool=5
2006 Feb 01
0
Nil in CSV Fixtures
The Guide to Testing the Rails
http://manuals.rubyonrails.com/read/chapter/26#page65
says about CSV fixtures:
nulls can be achived by just placing a comma, for example,
(1,sclaus,,false,) minus the parenthesis of course.
I tried that, but after the fixtures had been created, I checked the
value of the field in the DB and instead of nil the value was zero,
eventhough the default value for the
2006 Feb 24
1
rake freeze_edge doesn''t work
I got these messages running ''rake freeze_edge'' in the application
directory
rake aborted!
Don''t know how to build task ''freeze_edge''
What gives ?
TIA
--
Posted via http://www.ruby-forum.com/.
2006 Jan 04
0
Doesn''t "find" call initialize?
class Item < ActiveRecord::Base
def initialize(*args)
super
@x = 5
end
def print_x
puts @x
end
end
item_new = Item.new
item_new.print_x # output: 5
item_find = Item.find(1) # this record is in the database
item_find.print_x # output: nil
I thought the output would be 5 in both cases, since Item.find returns a
new object of Item and so Item.initialize