piggyback 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/piggyback.rb +18 -6
- data/piggyback.gemspec +2 -2
- metadata +10 -10
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
data/lib/piggyback.rb
CHANGED
@@ -9,15 +9,27 @@ module Piggyback
|
|
9
9
|
module ClassMethods
|
10
10
|
|
11
11
|
def define_attribute_methods
|
12
|
-
|
12
|
+
@attribute_methods_mutex.synchronize do
|
13
|
+
return if attribute_methods_generated?
|
14
|
+
|
15
|
+
columns = []
|
16
|
+
|
17
|
+
piggyback_attributes.values.each do |attribute|
|
13
18
|
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
if column = attribute.column
|
20
|
+
columns_hash[attribute.name] = column
|
21
|
+
columns << attribute.name
|
22
|
+
end
|
17
23
|
|
18
|
-
|
19
|
-
|
24
|
+
if klass = attribute.serialized_class
|
25
|
+
serialized_attributes[attribute.name] = klass
|
26
|
+
end
|
20
27
|
end
|
28
|
+
|
29
|
+
# This stunt is to call "super.super"
|
30
|
+
_define_attribute_methods = ActiveModel::AttributeMethods::ClassMethods::instance_method(:define_attribute_methods)
|
31
|
+
_define_attribute_methods.bind(self).call(columns)
|
32
|
+
|
21
33
|
end
|
22
34
|
super
|
23
35
|
end
|
data/piggyback.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "piggyback"
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.6.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Andreas Korth"]
|
9
|
-
s.date = "
|
9
|
+
s.date = "2012-02-10"
|
10
10
|
s.description = "Piggyback attributes from associated models with ActiveRecord"
|
11
11
|
s.email = "andreas.korth@gmail.com"
|
12
12
|
s.extra_rdoc_files = ["CHANGELOG", "README.markdown", "lib/piggyback.rb"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggyback
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
16
|
-
requirement: &
|
16
|
+
requirement: &2167595120 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.1.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2167595120
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: echoe
|
27
|
-
requirement: &
|
27
|
+
requirement: &2167594700 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2167594700
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2167594240 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2167594240
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sqlite3
|
49
|
-
requirement: &
|
49
|
+
requirement: &2167593780 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2167593780
|
58
58
|
description: Piggyback attributes from associated models with ActiveRecord
|
59
59
|
email: andreas.korth@gmail.com
|
60
60
|
executables: []
|