Class: RulesEngine::Publish::RePublishedPlan

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/rules_engine/publish/publisher/db_publisher.rb

Class Method Summary collapse

Class Method Details

.plan(plan_code, options = {}) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/rules_engine/publish/publisher/db_publisher.rb', line 9

def self.plan(plan_code, options = {})
  klass = self
  klass = klass.by_plan_code(plan_code)
  klass = klass.by_plan_version(options[:version]) if options[:version]
  klass = klass.order_plan_version('DESC')
  klass.find(:first)        
end

.plans(plan_code, options = {}) ⇒ Object



17
18
19
20
21
22
# File 'lib/rules_engine/publish/publisher/db_publisher.rb', line 17

def self.plans(plan_code, options = {})
  klass = self
  klass = klass.by_plan_code(plan_code)
  klass = klass.order_plan_version('DESC')
  klass.find(:all)        
end