active_session 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module ActiveSession
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -34,22 +34,16 @@ module ActiveSession
34
34
  return @#{name} if defined?(@#{name})
35
35
  @#{name} = #{klass}.find(#{foreign_key})
36
36
  end
37
- END
38
37
 
39
- class_eval <<-END, __FILE__, __LINE__ + 1
40
38
  def #{name}=(model)
41
39
  raise ActiveSession::AssociationTypeMismatch, "#{klass} expected, got \#\{model.class\}" unless model.nil? or model.is_a?(#{klass})
42
40
  self.#{foreign_key} = model.try(:id)
43
41
  end
44
- END
45
42
 
46
- class_eval <<-END, __FILE__, __LINE__ + 1
47
43
  def #{foreign_key}
48
44
  @attributes[:#{foreign_key}]
49
45
  end
50
- END
51
46
 
52
- class_eval <<-END, __FILE__, __LINE__ + 1
53
47
  def #{foreign_key}=(model_id)
54
48
  remove_instance_variable("@#{name}") if instance_variable_defined?("@#{name}")
55
49
  @attributes[:#{foreign_key}] = model_id
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_session
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2011-10-19 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
17
- requirement: &19802200 !ruby/object:Gem::Requirement
17
+ requirement: &13989540 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.1.1
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *19802200
25
+ version_requirements: *13989540
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
- requirement: &19801700 !ruby/object:Gem::Requirement
28
+ requirement: &13972600 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 3.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *19801700
36
+ version_requirements: *13972600
37
37
  description: ActiveModel session
38
38
  email:
39
39
  - qoobaa@gmail.com