mallet 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mallet (0.0.6)
4
+ mallet (0.0.7)
5
5
  actionmailer (~> 3.0)
6
6
  activerecord (~> 3.0)
7
7
  activesupport
@@ -5,7 +5,7 @@ module Mallet
5
5
 
6
6
  attr_accessible :workflow_state
7
7
 
8
- belongs_to :malletable, polymorphic: true
8
+ #belongs_to :malletable, polymorphic: true
9
9
 
10
10
  scope :pending, where(workflow_state: 'pending')
11
11
  scope :sent, where(workflow_state: 'sent')
@@ -32,6 +32,15 @@ module Mallet
32
32
  end
33
33
  end
34
34
 
35
+ def malletable
36
+ malletable_type.constantize.find(malletable_id)
37
+ end
38
+
39
+ def malletable=(thing)
40
+ self.malletable_type = thing.class.name
41
+ self.malletable_id = thing.id
42
+ end
43
+
35
44
  def validate
36
45
  raise Exception unless DEFINITIONS.has_key?(definition)
37
46
  raise Exception unless mailer_class.constantize.ancestors.include? ActionMailer::Base
@@ -1,3 +1,3 @@
1
1
  module Mallet
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-20 00:00:00.000000000 Z
13
+ date: 2013-05-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport