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
b3291a5c
Commit
b3291a5c
authored
Feb 28, 2009
by
Jack Danger Canty
Committed by
Martin Stannard
Nov 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reimplementing the good parts of
a7e0b8cb
A class named Approval in moderations/approval.rb raises no error Signed-off-by:
ctran
<
ctran@pragmaquest.com
>
parent
7e5260c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
annotate_models.rb
lib/annotate/annotate_models.rb
+7
-1
No files found.
lib/annotate/annotate_models.rb
View file @
b3291a5c
...
@@ -159,7 +159,13 @@ module AnnotateModels
...
@@ -159,7 +159,13 @@ module AnnotateModels
# Check for namespaced models in subdirectories as well as models
# Check for namespaced models in subdirectories as well as models
# in subdirectories without namespacing.
# in subdirectories without namespacing.
def
get_model_class
(
file
)
def
get_model_class
(
file
)
file
.
gsub
(
/\.rb$/
,
''
).
camelize
.
constantize
model
=
file
.
gsub
(
/\.rb$/
,
''
).
camelize
parts
=
model
.
split
(
'::'
)
begin
parts
.
inject
(
Object
)
{
|
klass
,
part
|
klass
.
const_get
(
part
)
}
rescue
LoadError
Object
.
const_get
(
parts
.
last
)
end
end
end
# We're passed a name of things that might be
# We're passed a name of things that might be
...
...
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