#rubyonrails - Sat 31 Mar 2007 between 08:09 and 08:21

NY Lost Funds



sashthebashanybody on this :/?
ben_hsashthebash: but every time i've had a strange problem crop up that's seemingly unrelated, it's been because i redefined something that rails was using.
sashthebashhow do I find out? It seems like the constant I defined is messing things up
but without the observer it is working
ben_he.g. i defined my own function called save() in a model (i didn't actually do THAT, that's a random example ;) that hosed rails' ability to save
to save that model
sashthebashit is now looking for a constant in my class Places, how can I tell ruby/rails that it is a global constant?
ben_hi don't know of a place to define global constants. it probably should be defined in a class somewhere
in the topmost class in which it will be used
sashthebashi think i found the problem
the observer seems to load the Place class, but I define the constant after the observer is loaded
ReinHsashthebash: ::Constant
sashthebashif i add the constant to the top of environment.rb it is working
then i just have to rewrite it because 24.hours doesnt work anymore
ReinHsashthebash: there are no such things as "global" constants
There are only constants that are in scope and constants that are not in scope
ben_hyeah, remember _everything_ is an object
Ashimseven you ben_h, are an object
ben_hhow dare you!
actionben_h objects to that
ben_hobjects to that
Ashims^_^
ReinHben_h: well, *most* things are objects
sashthebashwouldnt ben be an instance of an object :P?
ReinHRuby isn't smalltalk :)
sashthebash: instances are objects
ben_hlol
ReinHso are classes
Class is an object
Ashimsyou're not smalltalk! *accusingly*
ReinHObject is a class.
Think about it.
ben_han object is an instance of a class, which is also an instance of classes
Ashimsclasses aren't objects
ReinHAshims: yes they are.
Ashims: prove to me that they are not
ben_hyeah, they are
sashthebashthis is too much for me right now
lol
ben_hyou can pass around User as though it is an object
AshimsReinH: an Instanciation of a class in an object foo!

Page: 3 10 17 24 31 38 45 52 59 66 73 80 

IrcArchive

NY Lost Funds