def is_pos_activation?
    if session[:pos_activation]
      block_given? ? yield : true
...

Ruby better way?

by RoadHouse, July 21, 2010 18:48, 5 refactorings, tagged with ruby, block, if

i like this code, but exist...

70089e712ed13abb99bec89bd5bfba77 Talk
#insert new record if it dosent already exist
             if !dbh.select_one('SELECT Salenm FROM Auctions Where Salenm LIKE "%' + c.attributes["href"][/....$/] + '%"')
                dbh.do("INSERT INTO Auctions (Salenm, Date, Location) VALUES (?, ?, 1)", 
...

Ruby Insert new record if it dos...

by bain19.myopenid.com, June 24, 2010 04:33, 1 refactoring, tagged with mysql, if, select, bain19, sql injection

Is there a safer way to-do ...

642d333608cc3483f64dba38cb81bdd2 Talk
if current_user
      @var = current_user.search_terms.build
    else
...

Ruby if else more elegant

by RoadHouse, March 25, 2010 15:33, 5 refactorings, tagged with ruby, if

is a better way to do this?

70089e712ed13abb99bec89bd5bfba77 Talk
y_max = 10

arr_data.each do |arr|
...

Ruby 2D array manipulation

by asmega.myopenid.com, September 12, 2009 13:10, 1 refactoring, tagged with ruby, iterate, array, each, if, break, first

an array within array itera...

8969b3dc2e4211b514c08ee9879bb0c4 Talk
stuff.each do |name|
  name = name.downcase
  #size
...

Ruby ungliness and long too

by uberholden.myopenid.com, September 10, 2009 13:15, 6 refactorings, tagged with rails, ruby, if, case, if else

any ideas on making this mo...

55502f40dc8b7c769880b10874abc9d0 Talk
if @events != nil
  @events.each do |event|
    if @recurrents != nil
...

Ruby superfluous if statements

by ttdavett.myopenid.com, August 10, 2008 22:51, 4 refactorings, tagged with rails, ruby, if, else

I'm pretty sure theres a be...

F677fa685a2cfe8aff31f161062db3d3 Talk