api_resource 0.2.11 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +8 -2
- data/Gemfile.lock +85 -61
- data/VERSION +1 -1
- data/api_resource.gemspec +19 -9
- data/lib/api_resource.rb +46 -24
- data/lib/api_resource/associations.rb +15 -16
- data/lib/api_resource/associations/scope.rb +2 -1
- data/lib/api_resource/attributes.rb +72 -76
- data/lib/api_resource/base.rb +69 -53
- data/lib/api_resource/callbacks.rb +18 -22
- data/lib/api_resource/connection.rb +24 -1
- data/lib/api_resource/custom_methods.rb +23 -25
- data/lib/api_resource/formats.rb +9 -1
- data/lib/api_resource/model_errors.rb +36 -40
- data/lib/api_resource/observing.rb +9 -11
- data/lib/api_resource/scopes.rb +12 -12
- data/spec/lib/api_resource_spec.rb +43 -0
- data/spec/lib/associations_spec.rb +4 -3
- data/spec/lib/base_spec.rb +28 -0
- data/spec/spec_helper.rb +0 -1
- metadata +84 -50
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source "http://rubygems.org"
|
|
2
2
|
# Add dependencies required to use your gem here.
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
|
-
gem 'rails', '3
|
5
|
+
gem 'rails', '~> 3'
|
6
6
|
gem 'hash_dealer'
|
7
7
|
gem 'rest-client'
|
8
8
|
gem 'log4r'
|
@@ -10,6 +10,12 @@ gem 'differ'
|
|
10
10
|
gem 'colorize'
|
11
11
|
gem 'json', :require => 'json/ext'
|
12
12
|
|
13
|
+
group :development, :staging do
|
14
|
+
gem 'pry'
|
15
|
+
gem 'pry-doc'
|
16
|
+
gem 'pry-nav'
|
17
|
+
end
|
18
|
+
|
13
19
|
# Add dependencies to develop your gem here.
|
14
20
|
# Include everything needed to run rake, tests, features, etc.
|
15
21
|
group :development do
|
@@ -25,6 +31,6 @@ group :development do
|
|
25
31
|
gem 'mocha'
|
26
32
|
gem "bundler"
|
27
33
|
gem "jeweler", "~> 1.6.4"
|
28
|
-
gem 'activerecord', '3
|
34
|
+
gem 'activerecord', '~> 3'
|
29
35
|
gem "sqlite3"
|
30
36
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,50 +1,50 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
rack (~> 1.2
|
15
|
-
rack-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
4
|
+
actionmailer (3.2.6)
|
5
|
+
actionpack (= 3.2.6)
|
6
|
+
mail (~> 2.4.4)
|
7
|
+
actionpack (3.2.6)
|
8
|
+
activemodel (= 3.2.6)
|
9
|
+
activesupport (= 3.2.6)
|
10
|
+
builder (~> 3.0.0)
|
11
|
+
erubis (~> 2.7.0)
|
12
|
+
journey (~> 1.0.1)
|
13
|
+
rack (~> 1.4.0)
|
14
|
+
rack-cache (~> 1.2)
|
15
|
+
rack-test (~> 0.6.1)
|
16
|
+
sprockets (~> 2.1.3)
|
17
|
+
activemodel (3.2.6)
|
18
|
+
activesupport (= 3.2.6)
|
19
|
+
builder (~> 3.0.0)
|
20
|
+
activerecord (3.2.6)
|
21
|
+
activemodel (= 3.2.6)
|
22
|
+
activesupport (= 3.2.6)
|
23
|
+
arel (~> 3.0.2)
|
24
|
+
tzinfo (~> 0.3.29)
|
25
|
+
activeresource (3.2.6)
|
26
|
+
activemodel (= 3.2.6)
|
27
|
+
activesupport (= 3.2.6)
|
28
|
+
activesupport (3.2.6)
|
29
|
+
i18n (~> 0.6)
|
30
|
+
multi_json (~> 1.0)
|
31
31
|
archive-tar-minitar (0.5.2)
|
32
|
-
arel (
|
33
|
-
builder (
|
32
|
+
arel (3.0.2)
|
33
|
+
builder (3.0.0)
|
34
|
+
coderay (1.0.6)
|
34
35
|
colorize (0.5.8)
|
35
36
|
columnize (0.3.6)
|
36
37
|
diff-lcs (1.1.3)
|
37
38
|
differ (0.1.2)
|
38
|
-
erubis (2.
|
39
|
-
|
40
|
-
|
41
|
-
activesupport
|
39
|
+
erubis (2.7.0)
|
40
|
+
factory_girl (2.6.1)
|
41
|
+
activesupport (>= 2.3.9)
|
42
42
|
faker (1.0.1)
|
43
43
|
i18n (~> 0.4)
|
44
44
|
ffi (1.0.11)
|
45
45
|
git (1.2.5)
|
46
46
|
growl (1.0.3)
|
47
|
-
guard (0.
|
47
|
+
guard (1.0.1)
|
48
48
|
ffi (>= 0.5.0)
|
49
49
|
thor (~> 0.14.6)
|
50
50
|
guard-rspec (0.6.0)
|
@@ -53,45 +53,59 @@ GEM
|
|
53
53
|
activesupport
|
54
54
|
colorize
|
55
55
|
i18n
|
56
|
-
|
56
|
+
hike (1.2.1)
|
57
|
+
i18n (0.6.0)
|
57
58
|
jeweler (1.6.4)
|
58
59
|
bundler (~> 1.0)
|
59
60
|
git (>= 1.2.5)
|
60
61
|
rake
|
61
|
-
|
62
|
+
journey (1.0.4)
|
63
|
+
json (1.7.3)
|
62
64
|
linecache19 (0.5.12)
|
63
65
|
ruby_core_source (>= 0.1.4)
|
64
66
|
log4r (1.1.10)
|
65
|
-
mail (2.
|
66
|
-
activesupport (>= 2.3.6)
|
67
|
+
mail (2.4.4)
|
67
68
|
i18n (>= 0.4.0)
|
68
69
|
mime-types (~> 1.16)
|
69
70
|
treetop (~> 1.4.8)
|
70
71
|
metaclass (0.0.1)
|
71
|
-
|
72
|
-
|
72
|
+
method_source (0.7.1)
|
73
|
+
mime-types (1.19)
|
74
|
+
mocha (0.10.5)
|
73
75
|
metaclass (~> 0.0.1)
|
74
|
-
multi_json (1.
|
76
|
+
multi_json (1.3.6)
|
75
77
|
polyglot (0.3.3)
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
78
|
+
pry (0.9.9.6)
|
79
|
+
coderay (~> 1.0.5)
|
80
|
+
method_source (~> 0.7.1)
|
81
|
+
slop (>= 2.4.4, < 3)
|
82
|
+
pry-doc (0.4.2)
|
83
|
+
pry (>= 0.9.0)
|
84
|
+
yard (~> 0.8.1)
|
85
|
+
pry-nav (0.2.1)
|
86
|
+
pry (~> 0.9.9)
|
87
|
+
rack (1.4.1)
|
88
|
+
rack-cache (1.2)
|
89
|
+
rack (>= 0.4)
|
90
|
+
rack-ssl (1.3.2)
|
91
|
+
rack
|
92
|
+
rack-test (0.6.1)
|
80
93
|
rack (>= 1.0)
|
81
|
-
rails (3.
|
82
|
-
actionmailer (= 3.
|
83
|
-
actionpack (= 3.
|
84
|
-
activerecord (= 3.
|
85
|
-
activeresource (= 3.
|
86
|
-
activesupport (= 3.
|
94
|
+
rails (3.2.6)
|
95
|
+
actionmailer (= 3.2.6)
|
96
|
+
actionpack (= 3.2.6)
|
97
|
+
activerecord (= 3.2.6)
|
98
|
+
activeresource (= 3.2.6)
|
99
|
+
activesupport (= 3.2.6)
|
87
100
|
bundler (~> 1.0)
|
88
|
-
railties (= 3.
|
89
|
-
railties (3.
|
90
|
-
actionpack (= 3.
|
91
|
-
activesupport (= 3.
|
101
|
+
railties (= 3.2.6)
|
102
|
+
railties (3.2.6)
|
103
|
+
actionpack (= 3.2.6)
|
104
|
+
activesupport (= 3.2.6)
|
105
|
+
rack-ssl (~> 1.3.2)
|
92
106
|
rake (>= 0.8.7)
|
93
107
|
rdoc (~> 3.4)
|
94
|
-
thor (
|
108
|
+
thor (>= 0.14.6, < 2.0)
|
95
109
|
rake (0.9.2.2)
|
96
110
|
rdoc (3.12)
|
97
111
|
json (~> 1.4)
|
@@ -120,22 +134,29 @@ GEM
|
|
120
134
|
ruby-debug-base19 (>= 0.11.19)
|
121
135
|
ruby_core_source (0.1.5)
|
122
136
|
archive-tar-minitar (>= 0.5.2)
|
123
|
-
simplecov (0.
|
124
|
-
multi_json (~> 1.0
|
137
|
+
simplecov (0.6.1)
|
138
|
+
multi_json (~> 1.0)
|
125
139
|
simplecov-html (~> 0.5.3)
|
126
140
|
simplecov-html (0.5.3)
|
141
|
+
slop (2.4.4)
|
142
|
+
sprockets (2.1.3)
|
143
|
+
hike (~> 1.2)
|
144
|
+
rack (~> 1.0)
|
145
|
+
tilt (~> 1.1, != 1.3.0)
|
127
146
|
sqlite3 (1.3.5)
|
128
147
|
thor (0.14.6)
|
148
|
+
tilt (1.3.3)
|
129
149
|
treetop (1.4.10)
|
130
150
|
polyglot
|
131
151
|
polyglot (>= 0.3.1)
|
132
|
-
tzinfo (0.3.
|
152
|
+
tzinfo (0.3.33)
|
153
|
+
yard (0.8.2.1)
|
133
154
|
|
134
155
|
PLATFORMS
|
135
156
|
ruby
|
136
157
|
|
137
158
|
DEPENDENCIES
|
138
|
-
activerecord (
|
159
|
+
activerecord (~> 3)
|
139
160
|
bundler
|
140
161
|
colorize
|
141
162
|
differ
|
@@ -149,7 +170,10 @@ DEPENDENCIES
|
|
149
170
|
json
|
150
171
|
log4r
|
151
172
|
mocha
|
152
|
-
|
173
|
+
pry
|
174
|
+
pry-doc
|
175
|
+
pry-nav
|
176
|
+
rails (~> 3)
|
153
177
|
rest-client
|
154
178
|
rspec
|
155
179
|
rspec-rails
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/api_resource.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "api_resource"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ethan Langevin"]
|
12
|
-
s.date = "2012-06-
|
12
|
+
s.date = "2012-06-23"
|
13
13
|
s.description = "A replacement for ActiveResource for RESTful APIs that handles associated object and multiple data sources"
|
14
14
|
s.email = "ejl6266@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -60,6 +60,7 @@ Gem::Specification.new do |s|
|
|
60
60
|
"lib/api_resource/railtie.rb",
|
61
61
|
"lib/api_resource/scopes.rb",
|
62
62
|
"nohup.out",
|
63
|
+
"spec/lib/api_resource_spec.rb",
|
63
64
|
"spec/lib/associations_spec.rb",
|
64
65
|
"spec/lib/attributes_spec.rb",
|
65
66
|
"spec/lib/base_spec.rb",
|
@@ -80,20 +81,23 @@ Gem::Specification.new do |s|
|
|
80
81
|
s.homepage = "http://github.com/ejlangev/resource"
|
81
82
|
s.licenses = ["MIT"]
|
82
83
|
s.require_paths = ["lib"]
|
83
|
-
s.rubygems_version = "1.8.
|
84
|
+
s.rubygems_version = "1.8.11"
|
84
85
|
s.summary = "A replacement for ActiveResource for RESTful APIs that handles associated object and multiple data sources"
|
85
86
|
|
86
87
|
if s.respond_to? :specification_version then
|
87
88
|
s.specification_version = 3
|
88
89
|
|
89
90
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
90
|
-
s.add_runtime_dependency(%q<rails>, ["
|
91
|
+
s.add_runtime_dependency(%q<rails>, ["~> 3"])
|
91
92
|
s.add_runtime_dependency(%q<hash_dealer>, [">= 0"])
|
92
93
|
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
93
94
|
s.add_runtime_dependency(%q<log4r>, [">= 0"])
|
94
95
|
s.add_runtime_dependency(%q<differ>, [">= 0"])
|
95
96
|
s.add_runtime_dependency(%q<colorize>, [">= 0"])
|
96
97
|
s.add_runtime_dependency(%q<json>, [">= 0"])
|
98
|
+
s.add_development_dependency(%q<pry>, [">= 0"])
|
99
|
+
s.add_development_dependency(%q<pry-doc>, [">= 0"])
|
100
|
+
s.add_development_dependency(%q<pry-nav>, [">= 0"])
|
97
101
|
s.add_development_dependency(%q<rspec>, [">= 0"])
|
98
102
|
s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
|
99
103
|
s.add_development_dependency(%q<growl>, [">= 0"])
|
@@ -106,16 +110,19 @@ Gem::Specification.new do |s|
|
|
106
110
|
s.add_development_dependency(%q<mocha>, [">= 0"])
|
107
111
|
s.add_development_dependency(%q<bundler>, [">= 0"])
|
108
112
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
109
|
-
s.add_development_dependency(%q<activerecord>, ["
|
113
|
+
s.add_development_dependency(%q<activerecord>, ["~> 3"])
|
110
114
|
s.add_development_dependency(%q<sqlite3>, [">= 0"])
|
111
115
|
else
|
112
|
-
s.add_dependency(%q<rails>, ["
|
116
|
+
s.add_dependency(%q<rails>, ["~> 3"])
|
113
117
|
s.add_dependency(%q<hash_dealer>, [">= 0"])
|
114
118
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
115
119
|
s.add_dependency(%q<log4r>, [">= 0"])
|
116
120
|
s.add_dependency(%q<differ>, [">= 0"])
|
117
121
|
s.add_dependency(%q<colorize>, [">= 0"])
|
118
122
|
s.add_dependency(%q<json>, [">= 0"])
|
123
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
124
|
+
s.add_dependency(%q<pry-doc>, [">= 0"])
|
125
|
+
s.add_dependency(%q<pry-nav>, [">= 0"])
|
119
126
|
s.add_dependency(%q<rspec>, [">= 0"])
|
120
127
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
121
128
|
s.add_dependency(%q<growl>, [">= 0"])
|
@@ -128,17 +135,20 @@ Gem::Specification.new do |s|
|
|
128
135
|
s.add_dependency(%q<mocha>, [">= 0"])
|
129
136
|
s.add_dependency(%q<bundler>, [">= 0"])
|
130
137
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
131
|
-
s.add_dependency(%q<activerecord>, ["
|
138
|
+
s.add_dependency(%q<activerecord>, ["~> 3"])
|
132
139
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
133
140
|
end
|
134
141
|
else
|
135
|
-
s.add_dependency(%q<rails>, ["
|
142
|
+
s.add_dependency(%q<rails>, ["~> 3"])
|
136
143
|
s.add_dependency(%q<hash_dealer>, [">= 0"])
|
137
144
|
s.add_dependency(%q<rest-client>, [">= 0"])
|
138
145
|
s.add_dependency(%q<log4r>, [">= 0"])
|
139
146
|
s.add_dependency(%q<differ>, [">= 0"])
|
140
147
|
s.add_dependency(%q<colorize>, [">= 0"])
|
141
148
|
s.add_dependency(%q<json>, [">= 0"])
|
149
|
+
s.add_dependency(%q<pry>, [">= 0"])
|
150
|
+
s.add_dependency(%q<pry-doc>, [">= 0"])
|
151
|
+
s.add_dependency(%q<pry-nav>, [">= 0"])
|
142
152
|
s.add_dependency(%q<rspec>, [">= 0"])
|
143
153
|
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
144
154
|
s.add_dependency(%q<growl>, [">= 0"])
|
@@ -151,7 +161,7 @@ Gem::Specification.new do |s|
|
|
151
161
|
s.add_dependency(%q<mocha>, [">= 0"])
|
152
162
|
s.add_dependency(%q<bundler>, [">= 0"])
|
153
163
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
154
|
-
s.add_dependency(%q<activerecord>, ["
|
164
|
+
s.add_dependency(%q<activerecord>, ["~> 3"])
|
155
165
|
s.add_dependency(%q<sqlite3>, [">= 0"])
|
156
166
|
end
|
157
167
|
end
|
data/lib/api_resource.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'active_support/inflector'
|
3
|
-
require 'active_support/core_ext
|
4
|
-
require 'active_support/core_ext/
|
5
|
-
require 'active_support/core_ext/
|
6
|
-
require 'active_support/core_ext/class/
|
3
|
+
require 'active_support/core_ext'
|
4
|
+
#require 'active_support/core_ext/hash'
|
5
|
+
#require 'active_support/core_ext/object'
|
6
|
+
#require 'active_support/core_ext/class/attribute_accessors'
|
7
|
+
#require 'active_support/core_ext/class/inheritable_attributes'
|
7
8
|
require 'api_resource/core_extensions'
|
8
9
|
|
9
10
|
require 'active_model'
|
@@ -52,30 +53,31 @@ module ApiResource
|
|
52
53
|
Mocks.clear_endpoints
|
53
54
|
Mocks.init
|
54
55
|
|
55
|
-
Dir["#{File.dirname(__FILE__)}/../spec/support/requests/*.rb"].each {|f|
|
56
|
-
|
56
|
+
Dir["#{File.dirname(__FILE__)}/../spec/support/requests/*.rb"].each {|f|
|
57
|
+
require f
|
58
|
+
}
|
59
|
+
Dir["#{File.dirname(__FILE__)}/../spec/support/**/*.rb"].each {|f|
|
60
|
+
require f
|
61
|
+
}
|
57
62
|
end
|
58
|
-
|
63
|
+
|
59
64
|
class << self
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
+
|
66
|
+
delegate :site, :site=, :format, :format=,
|
67
|
+
:token, :token=, :timeout,
|
68
|
+
:open_timeout,
|
69
|
+
:reset_connection, :ttl, :ttl=,
|
70
|
+
:to => ApiResource::Base
|
71
|
+
|
65
72
|
end
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
self.token = new_token
|
72
|
-
yield
|
73
|
-
ensure
|
74
|
-
self.token = old_token
|
73
|
+
|
74
|
+
def self.cache(reset = false)
|
75
|
+
@cache = nil if reset
|
76
|
+
@cache ||= begin
|
77
|
+
defined?(Rails) ? Rails.cache : ActiveSupport::Cache::MemoryStore.new
|
75
78
|
end
|
76
79
|
end
|
77
80
|
|
78
|
-
|
79
81
|
# set the timeout val and reset the connection
|
80
82
|
def self.timeout=(val)
|
81
83
|
ApiResource::Base.timeout = val
|
@@ -89,8 +91,28 @@ module ApiResource
|
|
89
91
|
self.reset_connection
|
90
92
|
val
|
91
93
|
end
|
92
|
-
|
93
94
|
self.timeout = self.open_timeout = DEFAULT_TIMEOUT
|
95
|
+
|
96
|
+
# Run a block with a given token - useful for AroundFilters
|
97
|
+
def self.with_token(new_token, &block)
|
98
|
+
old_token = self.token
|
99
|
+
begin
|
100
|
+
self.token = new_token
|
101
|
+
yield
|
102
|
+
ensure
|
103
|
+
self.token = old_token
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def with_ttl(new_ttl, &block)
|
108
|
+
old_ttl = self.ttl
|
109
|
+
begin
|
110
|
+
self.ttl = new_ttl
|
111
|
+
yield
|
112
|
+
ensure
|
113
|
+
self.ttl = old_ttl
|
114
|
+
end
|
115
|
+
end
|
94
116
|
|
95
117
|
# logger
|
96
118
|
def self.logger
|
@@ -107,4 +129,4 @@ module ApiResource
|
|
107
129
|
# return @@logging = val
|
108
130
|
# end
|
109
131
|
|
110
|
-
end
|
132
|
+
end
|
@@ -20,8 +20,8 @@ module ApiResource
|
|
20
20
|
included do
|
21
21
|
|
22
22
|
raise "Cannot include Associations without first including AssociationActivation" unless self.ancestors.include?(ApiResource::AssociationActivation)
|
23
|
-
|
24
|
-
|
23
|
+
class_attribute :related_objects
|
24
|
+
|
25
25
|
# Hash to hold onto the definitions of the related objects
|
26
26
|
self.related_objects = RelatedObjectHash.new
|
27
27
|
self.association_types.keys.each do |type|
|
@@ -57,7 +57,8 @@ module ApiResource
|
|
57
57
|
klass_name = (options[:class_name] ? options[:class_name].to_s.classify : arg.to_s.classify)
|
58
58
|
# add this to any descendants - the other methods etc are handled by inheritance
|
59
59
|
([self] + self.descendants).each do |klass|
|
60
|
-
|
60
|
+
#We need to merge upon itself to generate a new object since the children all share their related objects with each other
|
61
|
+
klass.related_objects = klass.related_objects.merge(:#{assoc} => klass.related_objects[:#{assoc}].merge(arg.to_sym => klass_name))
|
61
62
|
end
|
62
63
|
# We need to define reader and writer methods here
|
63
64
|
define_association_as_attribute(:#{assoc}, arg)
|
@@ -154,19 +155,17 @@ module ApiResource
|
|
154
155
|
|
155
156
|
end
|
156
157
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
self.class.association_names
|
169
|
-
end
|
158
|
+
def association?(assoc)
|
159
|
+
self.class.association?(assoc)
|
160
|
+
end
|
161
|
+
|
162
|
+
def association_class_name(assoc)
|
163
|
+
self.class.association_class_name(assoc)
|
164
|
+
end
|
165
|
+
|
166
|
+
# list of all association names
|
167
|
+
def association_names
|
168
|
+
self.class.association_names
|
170
169
|
end
|
171
170
|
|
172
171
|
end
|