gem 'validates_email_format_of', '>= 1.5.1'
gem 'composite_primary_keys', '>= 6.0.1'
gem 'http_accept_language', '~> 2.0.0'
-gem 'paperclip', '~> 3.0'
+gem 'paperclip', '~> 4.0'
gem 'deadlock_retry', '>= 1.2.0'
gem 'openstreetmap-i18n-js', '>= 3.0.0.rc5.3', :require => 'i18n-js'
gem 'rack-cors'
scope :active, -> { where(:status => ["active", "confirmed"]) }
scope :public, -> { where(:data_public => true) }
+ has_attached_file :image,
+ :default_url => "/assets/:class/:attachment/:style.png",
+ :styles => { :large => "100x100>", :small => "50x50>" }
+
validates_presence_of :email, :display_name
validates_confirmation_of :email#, :message => ' addresses must match'
validates_confirmation_of :pass_crypt#, :message => ' must match the confirmation password'
validates_numericality_of :home_lon, :allow_nil => true
validates_numericality_of :home_zoom, :only_integer => true, :allow_nil => true
validates_inclusion_of :preferred_editor, :in => Editors::ALL_EDITORS, :allow_nil => true
+ validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
after_initialize :set_defaults
before_save :encrypt_password
after_save :spam_check
- has_attached_file :image,
- :default_url => "/assets/:class/:attachment/:style.png",
- :styles => { :large => "100x100>", :small => "50x50>" }
-
def self.authenticate(options)
if options[:username] and options[:password]
user = where("email = ? OR display_name = ?", options[:username], options[:username]).first
changesets_count integer DEFAULT 0 NOT NULL,
traces_count integer DEFAULT 0 NOT NULL,
diary_entries_count integer DEFAULT 0 NOT NULL,
- image_use_gravatar boolean DEFAULT true NOT NULL
+ image_use_gravatar boolean DEFAULT true NOT NULL,
+ image_content_type character varying(255)
);
INSERT INTO schema_migrations (version) VALUES ('20140117185510');
+INSERT INTO schema_migrations (version) VALUES ('20140210003018');
+
INSERT INTO schema_migrations (version) VALUES ('21');
INSERT INTO schema_migrations (version) VALUES ('22');