lib/carrierwave/orm/sequel.rb in carrierwave-0.4.0 vs lib/carrierwave/orm/sequel.rb in carrierwave-0.4.1
- old
+ new
@@ -5,31 +5,19 @@
module CarrierWave
module Sequel
include CarrierWave::Mount
def mount_uploader(column, uploader)
+ raise "You need to use Sequel 3.0 or higher. Please upgrade." unless ::Sequel::Model.respond_to?(:plugin)
super
alias_method :read_uploader, :[]
alias_method :write_uploader, :[]=
- if CarrierWave::Sequel.new_sequel?
- include CarrierWave::Sequel::Hooks
- include CarrierWave::Sequel::Validations
- else
- after_save "store_#{column}!"
- before_save "write_#{column}_identifier"
- before_destroy "remove_#{column}!"
- end
+ include CarrierWave::Sequel::Hooks
+ include CarrierWave::Sequel::Validations
end
-
- # Determine if we're using Sequel > 2.12
- #
- # ==== Returns
- # Bool:: True if Sequel 2.12 or higher False otherwise
- def self.new_sequel?
- ::Sequel::Model.respond_to?(:plugin)
- end
+
end # Sequel
end # CarrierWave
# Instance hook methods for the Sequel 3.x
module CarrierWave::Sequel::Hooks