def create
  allow_publish = logged_in? && @trend.allow_more_publishers?(params[:connection_id])
  if allow_publish && !@trend.include_publisher?(params[:connection_id])
...

Ruby what if I don't like too ma...

by edgarjs, October 21, 2010 15:50, 4 refactorings, tagged with rails, conditions, associations, controller, create, build, ifs

I want to avoid the abuse o...

380f2ee82510287050b118947e8526dd Talk
def show
    
    if params[:course_id] && permitted_to?(:browse, :videos)
...

Ruby Need to DRY this if-else up

by fnjord.myopenid.com, March 25, 2009 17:43, 3 refactorings, tagged with rails, ruby, dry, conditions, if else

I thought of creating a bef...

321bbdb120165eebbaf37e781d4ec71b Talk
def create
    @announcement =  current_account.announcements.build(params[:announcement])
    
...

Ruby Re-Refactor Mailer Conditions

by fnjord.myopenid.com, February 13, 2009 17:44, 2 refactorings, tagged with rails, ruby, conditions, controller, mailer

This is just a mess. It wou...

321bbdb120165eebbaf37e781d4ec71b Talk
in models/user.rb
...  

...

Ruby ActiveRecord Validations wi...

by mitch, May 31, 2008 19:49, 3 refactorings, tagged with validations, conditions

I've never run into a situa...

F1a42e15a7d426b8e717687794e0234b Talk