Skip to content

Commit

Permalink
adding :on => :create option to #has_ipaper_and_uses method
Browse files Browse the repository at this point in the history
  • Loading branch information
damrbaby committed Jan 12, 2011
1 parent 5177ee3 commit 462249b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/scribd_fu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ def strip_cache_string(url)
module ClassMethods

# Load and inject ScribdFu goodies
def has_ipaper_and_uses(str)
# opts can be :on => :create, defaults to :on => :save
def has_ipaper_and_uses(str, opts = {:on => :save })
check_environment
load_base_plugin(str)

include InstanceMethods

after_save :upload_to_scribd # This *MUST* be an after_save
send("after_#{opts[:on]}", :upload_to_scribd) # This *MUST* be an after_save
before_destroy :destroy_ipaper_document
end

Expand Down

0 comments on commit 462249b

Please sign in to comment.