1 class User < ActiveRecord::Base
4 # Include default devise modules. Others available are:
5 # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
6 devise :database_authenticatable, :registerable,
7 :recoverable, :rememberable, :trackable, :token_authenticatable, :validatable#, :confirmable
9 # Setup accessible (or protected) attributes for your model
10 attr_accessible :id, :name, :password, :password_confirmation, :remember_me , :email
13 self.ensure_authentication_token
18 self.authentication_token = nil
25 self.author.comics.each do |comic|
26 raise ActiveRecord::Rollback unless comic.destroy_with_story
28 self.author.panels.each do |panel|
29 raise ActiveRecord::Rollback unless panel.destroy_with_elements
32 self.author.artist.original_pictures.each do |original_picture|
33 raise ActiveRecord::Rollback unless original_picture.destroy_with_resource_picture
35 raise ActiveRecord::Rollback unless self.author.artist.destroy
37 raise ActiveRecord::Rollback unless self.author.destroy
38 raise ActiveRecord::Rollback unless super