Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
annotate
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
annotate
Commits
75e4bfa8
Commit
75e4bfa8
authored
Jul 27, 2012
by
Alex Chaffee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #85 from djreimer/master
JRuby ObjectSpace compatibility fix
parents
26f3d91e
83cacd72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
annotate_models.rb
lib/annotate/annotate_models.rb
+2
-5
No files found.
lib/annotate/annotate_models.rb
View file @
75e4bfa8
...
@@ -316,11 +316,8 @@ module AnnotateModels
...
@@ -316,11 +316,8 @@ module AnnotateModels
# Retrieve loaded model class by path to the file where it's supposed to be defined.
# Retrieve loaded model class by path to the file where it's supposed to be defined.
def
get_loaded_model
(
model_path
)
def
get_loaded_model
(
model_path
)
ObjectSpace
.
each_object
.
ObjectSpace
.
each_object
(
::
Class
).
select
{
|
c
|
select
{
|
c
|
c
.
ancestors
.
include?
(
ActiveRecord
::
Base
)
}.
Class
===
c
and
# note: we use === to avoid a bug in activesupport 2.3.14 OptionMerger vs. is_a?
c
.
ancestors
.
include?
(
ActiveRecord
::
Base
)
}.
detect
{
|
c
|
ActiveSupport
::
Inflector
.
underscore
(
c
)
==
model_path
}
detect
{
|
c
|
ActiveSupport
::
Inflector
.
underscore
(
c
)
==
model_path
}
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment