Project

General

Profile

« Previous | Next » 

Revision b2b7a13b

Added by Daniel Lobato Garcia about 9 years ago

Refs #3809 - Remove nested ternary and nil checking

View differences:

app/models/trend.rb
class Trend < ActiveRecord::Base
validates_lengths_from_database
after_save :create_values, :if => lambda{ |o| o.fact_value == nil }
after_destroy :destroy_values, :if => lambda{ |o| o.fact_value == nil }
after_save :create_values, :if => lambda{ |o| o.fact_value.nil? }
after_destroy :destroy_values, :if => lambda{ |o| o.fact_value.nil? }
belongs_to :trendable, :polymorphic => true
has_many :trend_counters, :dependent => :destroy

Also available in: Unified diff