recurs 0.0.4.5 → 0.0.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/recurs.rb +9 -13
  2. data/lib/recurs/version.rb +1 -1
  3. metadata +3 -3
@@ -197,7 +197,7 @@ module Recurs
197
197
  send :include, InstanceMethods
198
198
  if defined? ActiveRecord::Base
199
199
  if self.ancestors.include? ActiveRecord::Base
200
- send :include, ARBased
200
+ send :after_initialize, :set_attrs
201
201
  else
202
202
  send :include, NonARBased
203
203
  end
@@ -205,6 +205,7 @@ module Recurs
205
205
  send :include, NonARBased
206
206
  end
207
207
  send :extend, ModelClassMethods
208
+
208
209
  end
209
210
 
210
211
  end
@@ -221,27 +222,22 @@ module Recurs
221
222
 
222
223
  module NonARBased
223
224
  def initialize(args ={})
224
- @rrules ||= []
225
- @exrules ||= []
226
- @rdates ||= []
227
- @exdates ||= []
225
+ set_attrs
228
226
  super
229
227
  end
230
228
  end
231
229
 
232
- module ARBased
233
- def after_initialize(args ={})
230
+ module InstanceMethods
231
+ attr_accessor :repeats, :dtstart, :dtend
232
+
233
+ #self.after_initialize :set_attrs if defined? ActiveRecord::Base
234
+
235
+ def set_attrs
234
236
  @rrules ||= []
235
237
  @exrules ||= []
236
238
  @rdates ||= []
237
239
  @exdates ||= []
238
- super
239
240
  end
240
- end
241
-
242
- module InstanceMethods
243
- attr_accessor :repeats, :dtstart, :dtend
244
- #after_initialize :set_attrs
245
241
 
246
242
  def recurs
247
243
  r = @rrules
@@ -1,3 +1,3 @@
1
1
  module Recurs
2
- VERSION = "0.0.4.5"
2
+ VERSION = "0.0.4.6"
3
3
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 4
9
- - 5
10
- version: 0.0.4.5
9
+ - 6
10
+ version: 0.0.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve Caney Martin
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-20 00:00:00 +00:00
18
+ date: 2010-12-21 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency