1 class User < ActiveRecord::Base
5 # Include default devise modules. Others available are:
6 # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
7 devise :database_authenticatable, :registerable,
8 :recoverable, :rememberable, :trackable, :token_authenticatable, :validatable#, :confirmable
10 # Setup accessible (or protected) attributes for your model
11 attr_accessible :id, :name, :password, :password_confirmation, :remember_me , :email
14 self.ensure_authentication_token
19 self.authentication_token = nil
26 self.author.scrolls.each do |scroll|
27 raise ActiveRecord::Rollback unless scroll.destroy_with_scroll_panel
29 self.author.panels.each do |panel|
30 raise ActiveRecord::Rollback unless panel.destroy_with_elements
33 self.artist.original_pictures.each do |original_picture|
34 raise ActiveRecord::Rollback unless original_picture.destroy_with_resource_picture
36 raise ActiveRecord::Rollback unless self.artist.destroy
38 raise ActiveRecord::Rollback unless self.author.destroy
39 raise ActiveRecord::Rollback unless super