Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
acc8f754
Commit
acc8f754
authored
May 06, 2009
by
Jon Yurek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switched interpolations module from module methods to instance methods
parent
4fc132f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
lib/paperclip/interpolations.rb
+13
-13
No files found.
lib/paperclip/interpolations.rb
View file @
acc8f754
module
Paperclip
module
Interpolations
extend
self
def
self
.
[]=
name
,
block
(
class
<<
self
;
self
;
end
).
class_eval
do
define_method
(
name
,
&
block
)
end
define_method
(
name
,
&
block
)
end
def
self
.
[]
name
...
...
@@ -11,43 +11,43 @@ module Paperclip
end
def
self
.
all
(
singleton_methods
-
[
"[]="
,
"[]"
,
"all"
]
).
sort
self
.
instance_methods
(
false
).
sort
end
def
self
.
rails_root
attachment
,
style
def
rails_root
attachment
,
style
RAILS_ROOT
end
def
self
.
rails_env
attachment
,
style
def
rails_env
attachment
,
style
RAILS_ENV
end
def
self
.
class
attachment
,
style
def
class
attachment
,
style
attachment
.
instance
.
class
.
to_s
.
underscore
.
pluralize
end
def
self
.
basename
attachment
,
style
def
basename
attachment
,
style
attachment
.
original_filename
.
gsub
(
/
#{
File
.
extname
(
attachment
.
original_filename
)
}
$/
,
""
)
end
def
self
.
extension
attachment
,
style
def
extension
attachment
,
style
((
style
=
attachment
.
styles
[
style
])
&&
style
[
:format
])
||
File
.
extname
(
attachment
.
original_filename
).
gsub
(
/^\.+/
,
""
)
end
def
self
.
id
attachment
,
style
def
id
attachment
,
style
attachment
.
instance
.
id
end
def
self
.
id_partition
attachment
,
style
def
id_partition
attachment
,
style
(
"%09d"
%
attachment
.
instance
.
id
).
scan
(
/\d{3}/
).
join
(
"/"
)
end
def
self
.
attachment
attachment
,
style
def
attachment
attachment
,
style
attachment
.
name
.
to_s
.
downcase
.
pluralize
end
def
s
elf
.
s
tyle
attachment
,
style
def
style
attachment
,
style
style
||
attachment
.
default_style
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