Skip to content

Commit

Permalink
Fix images
Browse files Browse the repository at this point in the history
  • Loading branch information
jodyalbritton committed Jul 21, 2014
1 parent 837b730 commit ff4300d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/photo.rb
Expand Up @@ -4,4 +4,5 @@ class Photo < ActiveRecord::Base
acts_as_taggable # Alias for acts_as_taggable_on acts_as_taggable # Alias for acts_as_taggable_on
has_attached_file :file, :styles => {:large=> "700x567>", :medium => "400x267>", :thumb => "90x60>" }, :default_url => "/images/:style/missing.png" has_attached_file :file, :styles => {:large=> "700x567>", :medium => "400x267>", :thumb => "90x60>" }, :default_url => "/images/:style/missing.png"
validates_attachment_content_type :file, :content_type => /\Aimage\/.*\Z/ validates_attachment_content_type :file, :content_type => /\Aimage\/.*\Z/
validates_attachment_size :file, :in => 0.megabytes..4.megabytes
end end
1 change: 1 addition & 0 deletions app/models/post.rb
Expand Up @@ -4,6 +4,7 @@ class Post < ActiveRecord::Base
attr_accessor :search attr_accessor :search
has_attached_file :photo, :styles => { :large => "750x450#", :medium => "360x244#", :thumb => "100x100#" }, :default_url => ":style/missing.png" has_attached_file :photo, :styles => { :large => "750x450#", :medium => "360x244#", :thumb => "100x100#" }, :default_url => ":style/missing.png"
validates_attachment_content_type :photo, :content_type => /\Aimage\/.*\Z/ validates_attachment_content_type :photo, :content_type => /\Aimage\/.*\Z/
validates_attachment_size :photo, :in => 0.megabytes..4.megabytes
crop_attached_file :photo, :aspect => "16:9" crop_attached_file :photo, :aspect => "16:9"
belongs_to :author, :class_name => 'User' belongs_to :author, :class_name => 'User'
belongs_to :category belongs_to :category
Expand Down
3 changes: 2 additions & 1 deletion app/models/sponsor.rb
@@ -1,7 +1,8 @@
class Sponsor < ActiveRecord::Base class Sponsor < ActiveRecord::Base
extend FriendlyId extend FriendlyId
has_attached_file :avatar, :styles => { :large => "600x403#", :medium => "300x300#", :thumb => "100x100>" }, :default_url => ":style/missing.png" has_attached_file :avatar, :styles => { :large => "640x480>", :medium => "300x300>", :thumb => "100x100>" }, :default_url => ":style/missing.png"
validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/ validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
validates_attachment_size :avatar, :in => 0.megabytes..4.megabytes
friendly_id :name, use: :slugged friendly_id :name, use: :slugged
has_many :videos has_many :videos
belongs_to :category belongs_to :category
Expand Down

0 comments on commit ff4300d

Please sign in to comment.