Create a gist now

Instantly share code, notes, and snippets.

@dtakahas /babby.rb
Last active Dec 16, 2015

What would you like to do?
How is babby formed in Rails?
class Babby < PragnentGirl::GetPragnent
attr_accessible :name, :mother, :location, :pragnent_girl_id
belongs_to :pragnent_girl
before_save :destroy_instain_mothers
after_save :pary_for_father
#How is babby formed?
def initialize(name, mother_id)
@name = name
@pragnent_girl_id = mother_id
@mother = PragnentGirl.find(mother_id).name
@location = "ar"
end
private
#They need to do way instain mother> who kill thier babbys. becuse these babby cant frigth back
def destroy_instain_mothers
@mothers = Mother.where(:babby_can_frigth_back => false)
@mothers.each do |mother|
do_way(mother) if mother.instain?
end
end
# i am truley sorry for your lots
def pary_for_father
@fathers = Father.where(:chrilden_status => "lost")
@fathers.each do |father|
pary_for(father)
end
end
end
@alecmatias

This comment has been minimized.

Show comment Hide comment
@alecmatias

alecmatias Apr 11, 2013

Michelangelo's Statue of David, Picasso's Les Demoiselles d'Avignon, and now Takahashi's babby.rb

Michelangelo's Statue of David, Picasso's Les Demoiselles d'Avignon, and now Takahashi's babby.rb

@kevinebaugh

This comment has been minimized.

Show comment Hide comment
@kevinebaugh

kevinebaugh Apr 12, 2013

<3

<3

@karmiclychee

This comment has been minimized.

Show comment Hide comment
@karmiclychee

karmiclychee Apr 12, 2013

me.age == 12 && this.is_a?

me.age == 12 && this.is_a?

@Fustrate

This comment has been minimized.

Show comment Hide comment
@Fustrate

Fustrate Apr 12, 2013

class LatvianGoToMarketGetPotato
  def goings_to_market(market)
    ride(:horse).to(market)
    # horse die
    ride(:horse).to(market)
    # horse die more
    ride(:horse).to(market)
    # is at market!

    be_sad unless market.have_potato?

    walk(:back)
  end
end

class Market
  def have_potato?
    false # are always false, market never have potato
  end
end
class LatvianGoToMarketGetPotato
  def goings_to_market(market)
    ride(:horse).to(market)
    # horse die
    ride(:horse).to(market)
    # horse die more
    ride(:horse).to(market)
    # is at market!

    be_sad unless market.have_potato?

    walk(:back)
  end
end

class Market
  def have_potato?
    false # are always false, market never have potato
  end
end
@nixpulvis

This comment has been minimized.

Show comment Hide comment
@nixpulvis

nixpulvis Apr 12, 2013

This is glorious. Roflmao.

This is glorious. Roflmao.

@xraystyle

This comment has been minimized.

Show comment Hide comment
@xraystyle

xraystyle Apr 24, 2013

This needs to be a gem. Every Rails app needs this functionality.

This needs to be a gem. Every Rails app needs this functionality.

@darth10

This comment has been minimized.

Show comment Hide comment
@darth10

darth10 Mar 13, 2014

Indeed 👍

darth10 commented Mar 13, 2014

Indeed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment