#rubyonrails - Mon 2 Apr 2007 between 00:00 and 00:37

NY Lost Funds



pstickneyour map is likely broken
roygbivunless you have specific logic to stick a nil in the array explicity
psticknewhat does it do without it?
eg: [???].map => [nil]
AngryElfhow come User.find(current_user) doesn't want to work inside the model I've created myself? Other than passing the variable is there another way at it?
psticknebecause current_user is likely a CONTROLLER method
magic_hatpstickne: there's no specific logic to stick a nil in there... http://pastie.caboo.se/51051
psticknemagic_hat, we can argue about this, or you can DUMP the contents of the resultant array BEFORE -and- AFTER the map
magic_hat, if [nil].map => then you would get an Exception
omninerdok, say I have a model for User ... is there a way to change a string "User" into a class reference so that I could do something like "User".some_method so that it'd function like User.some_method ?
pstickne(because you would try to invoke #project on it)
magic_hat, so, logically: the map _must_ be broken (or just not doing as you expect) if @projects.size == 1 and @projects[0] == nil
Object.const_get("User") => User
omninerd, But doing something like that might warrant further investigation...
omninerdpstickne, thanks
magic_hatI think it's because I have some mismatched association records. In other words, I have a user with id=1, a role record connecting him to project id=2, and no matching record in my project table.
pstickneI would concur.
magic_hatno worries, these are just test tables.
pstickneyou can use compact to get rid of nils; if @records.map(:&whatever).compact.size > 0 then ... #
cardioidObject.const_get? Not Inflector.constantize?
roygbivis there a way to print my current schema version using rake db:migrate?
jbarketQuestion. Is it possible to have a date_select have the most recent year at the top, rather than the oldest?
crayz_has anyone written ruby code for centrally managing a group of servers - i.e. running tasks/commands, grabbing information? I'm trying to not reinvent the wheel or find a generally accepted framework for doing this
Adam12crayz_: There is a gem called 'puppet' that *might* do what you want, but I have never used it, so ymmv.
jbarketoh hell I could just flip start and end year... doh
crayz_hmm, puppet looks interesting. thanks
AngryElfwith after_save :foo how can I get the newly created foo object?
sorry, confused myself here -- how can I get the new object from within the foo method?
ylonI'm I'm using flash for feedback, are the area names such as :notice, :warning and :error set somewhere or are they just normal conventions, ie, could I say :bad_error as well?
jbcheyas :)
Does script/runner require the application to be running?
_focaylon, you can put anything you want
ylonI've looked around in the rdoc at api.rubyonrails.com and not seen anything like these items relating to flash
werdnativAngryElf: isn't it just self?
_focathey are only conventions
ylon_foca: okay, that would explain it, those are just normal conventions folks use.
AngryElfwerdnativ, maybe?
ylongreat, thanks _foca
_focawelcome
AngryElfwerdnativ, seems to be, thanx

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 

IrcArchive

NY Lost Funds