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
36a91fef
Commit
36a91fef
authored
Jan 05, 2014
by
Kylan McBride
Committed by
Jon Yurek
Feb 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Callbacks: Added Rails 4.1+ terminator conditional
parent
44df8639
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
1 deletions
+30
-1
.travis.yml
+3
-0
Appraisals
+5
-0
gemfiles/4.1.gemfile
+11
-0
lib/paperclip/callbacks.rb
+11
-1
No files found.
.travis.yml
View file @
36a91fef
...
...
@@ -17,6 +17,7 @@ gemfile:
-
gemfiles/3.1.gemfile
-
gemfiles/3.2.gemfile
-
gemfiles/4.0.gemfile
-
gemfiles/4.1.gemfile
matrix
:
allow_failures
:
...
...
@@ -26,3 +27,5 @@ matrix:
exclude
:
-
rvm
:
1.9.2
gemfile
:
gemfiles/4.0.gemfile
-
rvm
:
1.9.2
gemfile
:
gemfiles/4.1.gemfile
Appraisals
View file @
36a91fef
...
...
@@ -17,3 +17,8 @@ appraise "4.0" do
gem "rails", "~> 4.0.0"
gem "paperclip", :path => "../"
end
appraise "4.1" do
gem "rails", "~> 4.1.0.beta"
gem "paperclip", :path => "../"
end
gemfiles/4.1.gemfile
0 → 100644
View file @
36a91fef
# This file was generated by Appraisal
source "https://rubygems.org"
gem "jruby-openssl", :platform=>:jruby
gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
gem "sqlite3", :platform=>:ruby
gem "rails", "~> 4.1.0.beta"
gem "paperclip", :path=>"../"
gemspec :path=>"../"
lib/paperclip/callbacks.rb
View file @
36a91fef
...
...
@@ -7,7 +7,7 @@ module Paperclip
module
Defining
def
define_paperclip_callbacks
(
*
callbacks
)
define_callbacks
*
[
callbacks
,
{
terminator:
->
(
target
,
result
)
{
result
==
false
}
}].
flatten
define_callbacks
*
[
callbacks
,
{
:terminator
=>
callback_terminator
}].
flatten
callbacks
.
each
do
|
callback
|
eval
<<-
end_callbacks
def before_
#{
callback
}
(*args, &blk)
...
...
@@ -19,6 +19,16 @@ module Paperclip
end_callbacks
end
end
private
def
callback_terminator
if
Gem
::
Version
.
new
(
::
Rails
::
VERSION
::
STRING
)
>=
Gem
::
Version
.
new
(
'4.1.0.beta'
)
lambda
{
|
target
,
result
|
result
==
false
}
else
'result == false'
end
end
end
module
Running
...
...
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