Skip to content

Commit

Permalink
Paperclip::Interpolations was trying to access the Rails constant; ov…
Browse files Browse the repository at this point in the history
…errode those module methods and include it in spec_helper.
  • Loading branch information
aantix committed Nov 17, 2010
1 parent 412c74c commit 9bb628b
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 36 deletions.
95 changes: 60 additions & 35 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion lib/sex_it_up.rb
Expand Up @@ -9,7 +9,6 @@
module SexItUp module SexItUp


class SexItUpImage < ActiveRecord::Base class SexItUpImage < ActiveRecord::Base
#include Paperclip


attr_reader :sizes attr_reader :sizes
puts "before has_attached" puts "before has_attached"
Expand Down
13 changes: 13 additions & 0 deletions spec/initializers/paperclip.rb
@@ -0,0 +1,13 @@
module Paperclip
module Interpolations
# Returns the Rails.root constant.
def rails_root attachment, style_name
ROOT_DIR
end

# Returns the Rails.env constant.
def rails_env attachment, style_name
'test'
end
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -9,6 +9,8 @@
require 'active_support' require 'active_support'
require 'logger' require 'logger'


require 'initializers/paperclip'

gem 'sqlite3-ruby' gem 'sqlite3-ruby'


DB = '/tmp/jobs.sqlite' DB = '/tmp/jobs.sqlite'
Expand Down

0 comments on commit 9bb628b

Please sign in to comment.