pothoven-attachment_fu 3.2.11 → 3.2.12

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/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ * Apr 17, 2014 *
2
+ * Pull in changes from jasonbuehler to fix Rails 4 errors
3
+
1
4
  * Jan 7, 2014 *
2
5
  * Pull in changes from twelvelabs to fix gem use in Rails 2
3
6
 
@@ -325,7 +325,7 @@ module Technoweenie # :nodoc:
325
325
  :filename => thumbnail_name_for(file_name_suffix),
326
326
  :thumbnail_resize_options => size
327
327
  }
328
- if defined?(Rails) && Rails::VERSION::MAJOR >= 3
328
+ if defined?(Rails) && Rails::VERSION::MAJOR == 3
329
329
  # assign_attributes API in Rails 2.3 doesn't take a second argument
330
330
  assign_attributes_args << { :without_protection => true }
331
331
  end
@@ -475,9 +475,15 @@ module Technoweenie # :nodoc:
475
475
 
476
476
  # Initializes a new thumbnail with the given suffix.
477
477
  def find_or_initialize_thumbnail(file_name_suffix)
478
- respond_to?(:parent_id) ?
479
- thumbnail_class.find_or_initialize_by_thumbnail_and_parent_id(file_name_suffix.to_s, id) :
480
- thumbnail_class.find_or_initialize_by_thumbnail(file_name_suffix.to_s)
478
+ if defined?(Rails) && Rails::VERSION::MAJOR >= 4
479
+ respond_to?(:parent_id) ?
480
+ thumbnail_class.find_or_initialize_by(:thumbnail => file_name_suffix.to_s, :parent_id => id) :
481
+ thumbnail_class.find_or_initialize_by(:thumbnail => file_name_suffix.to_s)
482
+ else
483
+ respond_to?(:parent_id) ?
484
+ thumbnail_class.find_or_initialize_by_thumbnail_and_parent_id(file_name_suffix.to_s, id) :
485
+ thumbnail_class.find_or_initialize_by_thumbnail(file_name_suffix.to_s)
486
+ end
481
487
  end
482
488
 
483
489
  # Stub for a #process_attachment method in a processor
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pothoven-attachment_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.11
4
+ version: 3.2.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-07 00:00:00.000000000 Z
13
+ date: 2014-04-17 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: This is a fork of Rick Olson's attachment_fu adding Ruby 1.9 and Rails
16
16
  3.2 support as well as some other enhancements.