lib/generators/freeberry/models/templates/models/picture.rb in freeberry-0.2.5 vs lib/generators/freeberry/models/templates/models/picture.rb in freeberry-0.2.6
- old
+ new
@@ -25,11 +25,14 @@
class Picture < Asset
has_attached_file :data,
:url => "/assets/pictures/:id/:style_:basename.:extension",
:path => ":rails_root/public/assets/pictures/:id/:style_:basename.:extension",
:convert_options => { :all => "-strip" },
- :styles => { :content => '575>', :thumb => '80x80#', :cover => '400x250#' }
+ :styles => { :content => '575>', :thumb => '80x80#' }
validates_attachment_size :data, :less_than => 2.megabytes
+ validates_attachment_content_type :data, :content_type => Freeberry::IMAGE_TYPES
attr_accessible :data
+
+ default_scope order("#{quoted_table_name}.sort_order")
end