actic 0.0.2.1.1 → 0.0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,19 +4,15 @@ class Component < ActiveRecord::Base
4
4
 
5
5
  def set_component
6
6
  @component = self.ical if (self.ical != nil)
7
- if self.is_a? Calendar
8
- @component ||= RiCal.Calendar
9
- elsif self.is_a? Event
10
- @component ||= RiCal.Event
11
- elsif self.is_a? Todo
12
- @component ||= RiCal.Todo
13
- elsif self.is_a? Journal
14
- @component ||= RiCal.Journal
15
- elsif self.is_a? Alarm
16
- @component ||= RiCal.Alarm
17
- elsif self.is_a? FreeBusy
18
- @component ||= RiCal.Freebusy
19
- end
7
+
8
+ [[Calendar, RiCal.Calendar], [Event, RiCal.Event], [Todo, RiCal.Todo],
9
+ [Journal, RiCal.Journal], [Alarm, RiCal.Alarm], [FreeBusy, RiCal.Freebusy]].each {|comp|
10
+
11
+ if self.is_a? comp[0]
12
+ @component ||= comp[1]
13
+ break
14
+ end
15
+ }
20
16
  self.ical = @component.to_rfc2445_string if self.ical.nil?
21
17
  @component
22
18
  end
@@ -24,13 +20,13 @@ class Component < ActiveRecord::Base
24
20
  def add_component(sub_component)
25
21
  if sub_component.is_a? Event
26
22
  self.component.events << sub_component.component
27
- elsif component.is_a? Todo
23
+ elsif sub_component.is_a? Todo
28
24
  self.component.todos << sub_component.component
29
- elsif component.is_a? Journal
25
+ elsif sub_component.is_a? Journal
30
26
  self.component.journals << sub_component.component
31
- elsif component.is_a? Alarm
27
+ elsif sub_component.is_a? Alarm
32
28
  self.component.alarms << sub_component.component
33
- elsif component.is_a? FreeBusy
29
+ elsif sub_component.is_a? FreeBusy
34
30
  self.component.freebusys << sub_component.component
35
31
  end
36
32
  self.ical = self.component.to_rfc2445_string
@@ -1,7 +1,7 @@
1
1
  class Pattern < ActiveRecord::Base
2
2
  belongs_to :owner, :polymorphic => true
3
3
 
4
- def owner_type=(sType)
5
- super(sType.to_s.classify.constantize.base_class.to_s)
4
+ def owner_type=(stype)
5
+ super(stype.to_s.classify.constantize.base_class.to_s)
6
6
  end
7
7
  end
metadata CHANGED
@@ -6,9 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 2
9
- - 1
10
- - 1
11
- version: 0.0.2.1.1
9
+ - 2
10
+ version: 0.0.2.2
12
11
  platform: ruby
13
12
  authors: []
14
13
 
@@ -47,7 +46,7 @@ dependencies:
47
46
  type: :runtime
48
47
  prerelease: false
49
48
  version_requirements: *id002
50
- description: Actic is a calendaring engine for Rails3, it combines an iCal with ORM and acts as a wrapper around the RICal library
49
+ description: Actic is a calendaring engine for Rails3, it combines an iCal interface with ORM. It acts as a wrapper around the RiCal library
51
50
  email:
52
51
  executables: []
53
52
 
@@ -91,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
90
  requirements:
92
91
  - - ">="
93
92
  - !ruby/object:Gem::Version
94
- hash: 2300152984235825757
93
+ hash: 4058765439295397492
95
94
  segments:
96
95
  - 0
97
96
  version: "0"
@@ -100,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - ">="
102
101
  - !ruby/object:Gem::Version
103
- hash: 2300152984235825757
102
+ hash: 4058765439295397492
104
103
  segments:
105
104
  - 0
106
105
  version: "0"