Sha256: 7208a62576632eadf21e4c5f857f27c7d900fc6e2486930e9b140de85ea5274e

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

module Rooler
  class Template < ActiveRecord::Base
    has_many :rules
    has_many :deliveries, as: :deliverable
    validates :name, :to, :subject, :body, presence: true
    
    def test_object
      object = nil
      rules.each do |rule|
        object = rule.send(:find_by_klass).first
        break if object
      end
      object ||= nil
    end
    
    
    def liquid_method_tree
      object = test_object
      LiquidInspector.new(object.class).tree if object
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rooler-0.0.11 app/models/rooler/template.rb