calling own classes within RoR

D

dc

hiya!

i am seeing some odd behavior inside a controller. I am including my
own class and calling methods on it. some of them work, and some of
them dont... very odd.

in top of the controller:
require "lib/swfcat/swfroom"

def preview
@swfRoomObj = SwfRoom.new
@swfRoomObj.loadRoom(@params['id']) #this works
@swfRoomObj.roomRender(true) # this says "undefined method `roomRender' "
end

i cant understand why one method would work and the other not?
also, is there some odd caching of objects/classes going on? it seems
sometimes it takes a while for changes in source to be reflected in
server (usign webbrick/radrails)

tx!

/dc
 
D

dc

hi matt -
Your problem sounds generic enough, though, that I will at least
venture some help.

thanks. it turns out tho that this is a Rails object caching issue.
classes that are Rails controllers etc can have caching turned off,
but /lib/ and other classes i create, i can't discover how to turn
off caching... so have to reboot the webserver every test cycle.

how is compiled object caching done in ruby? this is a general
question, but woud give me some ideas where to look in rails source...

tx!
 
J

Jonas Hartmann

dc said:
hi matt -


thanks. it turns out tho that this is a Rails object caching issue.
classes that are Rails controllers etc can have caching turned off,
but /lib/ and other classes i create, i can't discover how to turn
off caching... so have to reboot the webserver every test cycle.

how is compiled object caching done in ruby? this is a general
question, but woud give me some ideas where to look in rails source...

tx!

include Reloadable (only works with classes not with modules afaik)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top