Hi, this blog is no longer maintained, my new blog is here

Ruby On Rails and a Conning Israeli entrepreneur

get classes of a class

  1. def get_all_subclasses_of(string)
  2. raise ArgumentError.new("#{string} is not an AR Class") if eval(string).class.ancestors
  3. .collect {|e| e.to_s.downcase}.include? ("ActiveRecord::Base")
  4. return ObjectSpace.subclasses_of(eval(string))
  5. end

0 comments:


The Web Ask eizesus.com

Subscribe

    follow me on Twitter

    Twiters Around

    About Me

    My photo
    I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.

    Labels