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.
- data/lib/recurs.rb +9 -13
- data/lib/recurs/version.rb +1 -1
- metadata +3 -3
data/lib/recurs.rb
CHANGED
@@ -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 :
|
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
|
-
|
225
|
-
@exrules ||= []
|
226
|
-
@rdates ||= []
|
227
|
-
@exdates ||= []
|
225
|
+
set_attrs
|
228
226
|
super
|
229
227
|
end
|
230
228
|
end
|
231
229
|
|
232
|
-
module
|
233
|
-
|
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
|
data/lib/recurs/version.rb
CHANGED
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.0.4.
|
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-
|
18
|
+
date: 2010-12-21 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|