def self.blank
o = new
...
o
end
end
o = TestOffer.blank()
puts o.getClass.toString() #prints "class models.Offer"
-- Is this a bug or a feature?
(I'm using new-ish Mirah, since the new one breaks my old Dubious (new
Dubious is unusably slow))
--
S pozdravem, Regards
Michal Hantl
gtalk/jabber: mic...@hantl.cz
icq: 241813215
class Offer < Model
def self.blank
new
end
end
class TestOffer < Offer
end
o = TestOffer.blank()
puts o.getClass.toString() #prints "class models.Offer"
ls:
michal@domov:~/mystuff/Kyle$ ls config
application.properties asset.properties build.properties
That's how java static methods work. I've got a few ideas for ways we could implement class methods like ruby has, where self is the class you you used to call the method, but nothing is implemented yet. For now your best bet is to copy that method into each subclass.
-- Sent from my phone
I'm currently doing Mirah fulltime as a startup and older version of
Dubious works great for me (even though it has some crazy
bugs/features).
I've extended dubious a little (more freedom in controllers, testing
and file uploads) and will try the new one later. (Last time I lost a
dat migrating my app to the new Dubious and back.)
Which books do you recomend to learn Java?
(I'm used to programming in Ruby, JS, PHP did some Haskell and Prolog)
I did post about speed Issues earlier - 18s lag after changing a view
is way too much.
I'm currently doing Mirah fulltime as a startup and older version of
Dubious works great for me (even though it has some crazy
bugs/features).
I've extended dubious a little (more freedom in controllers, testing
and file uploads) and will try the new one later. (Last time I lost a
dat migrating my app to the new Dubious and back.)