Ruby On Condensing nested conditionals

by Nick, November 12, 2008 17:56

Interesting solution, Adam!...

49de4cd2f26705785cbef2b15a9df7aa Talk

Ruby On Condensing nested conditionals

by Nick, November 12, 2008 00:40

Hi Adam. You're correct abo...

49de4cd2f26705785cbef2b15a9df7aa Talk
1
2
3
class PropertiesController < ApplicationController
  before_filter :authorise_action
...

Ruby Condensing nested conditionals

by Nick, November 11, 2008 21:28, 4 refactorings, tagged with ruby rails condense conditions

The code below works, but f...

49de4cd2f26705785cbef2b15a9df7aa Talk

Ruby On DRY up a controller action

by Nick, November 03, 2008 05:46

Hey Adam. There's a Propert...

49de4cd2f26705785cbef2b15a9df7aa Talk

Ruby On DRY up a controller action

by Nick, November 01, 2008 17:10

Thanks Jarkko. The action's...

49de4cd2f26705785cbef2b15a9df7aa Talk
1
2
3
filename    = 'process.log'
ids         = {}
...

Bash On Groupping with stats

by Nick, November 01, 2008 16:57 Star_fullStar_full

I'd write a small script fo...

49de4cd2f26705785cbef2b15a9df7aa Talk
1
2
3
4
# GET /neighbourhoods/map_filter
def map_filter
  @map_filter_errors  = nil # Stores errors related to a filter request.
...

Ruby DRY up a controller action

by Nick, October 31, 2008 20:52, 5 refactorings, tagged with rails fat controller

My Neighbourhood "map_filte...

49de4cd2f26705785cbef2b15a9df7aa Talk
1
2
3
4
class PropertyFilter < ActiveRecord::BaseWithoutTable
  attr_accessible :price_direction, :price # ...many more attributes...

...

Ruby On DRYing/shortening form proc...

by Nick, October 30, 2008 17:25

Hey Adam, thanks for the re...

49de4cd2f26705785cbef2b15a9df7aa Talk
1
2
3
4
  def self.filter_price(direction, price)
    return nil if direction.blank? or price.blank?
    return {:error => 'Invalid argument: direction'} unless ['at most', 'at least'].include? direction
...

Ruby DRYing/shortening form proc...

by Nick, October 24, 2008 20:03, 2 refactorings, tagged with process rails form

In my Rails app, the Proper...

49de4cd2f26705785cbef2b15a9df7aa Talk