Commit 20ac5a5c
Changed files (6)
app
app/models/admin_user.rb
@@ -1,9 +1,3 @@
class AdminUser < ActiveRecord::Base
- # Include default devise modules. Others available are:
- # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
- devise :database_authenticatable,
- :recoverable, :rememberable, :trackable, :validatable
-
- # Setup accessible (or protected) attributes for your model
- #attr_accessible :email, :password, :password_confirmation, :remember_me
+ devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable
end
app/models/favorite.rb
@@ -1,5 +1,4 @@
class Favorite < ActiveRecord::Base
belongs_to :user
belongs_to :creation, :counter_cache => true
- #attr_accessible :user_id, :creation_id
end
app/models/interest.rb
@@ -1,3 +1,2 @@
class Interest < ActiveRecord::Base
- #attr_accessible :name
end
app/models/photo.rb
@@ -1,5 +1,4 @@
class Photo < ActiveRecord::Base
- #attr_accessible :is_primary, :creation, :image
belongs_to :creation, :counter_cache => true
validates :image, :presence => true
mount_uploader :image, PhotoUploader
app/models/tutorial.rb
@@ -1,11 +1,8 @@
class Tutorial < ActiveRecord::Base
- #attr_accessible :description, :heading, :url, :image_url, :user_id, :author, :author_url
validates :url, :presence => true
belongs_to :user
acts_as_taggable
- #default_scope -> { order("created_at DESC") }
-
def to_param
"#{id}-#{heading.gsub(/[^a-z0-9]+/i, '-')}"
end
app/models/user.rb
@@ -10,11 +10,9 @@ class User < ActiveRecord::Base
validates :name, :presence => true
validates :website, :format => URI::regexp(%w(http https)), :allow_blank => true
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable
- #attr_accessible :name, :email, :website, :twitter, :facebook, :city, :latitude, :longitude, :password, :password_confirmation, :current_password, :remember_me, :interest_ids
has_many :creations, :dependent => :destroy
has_many :favorites, :dependent => :destroy
has_many :tutorials, :dependent => :destroy
- #has_and_belongs_to_many :interests, :join_table => 'users_interests', uniq: true, :autosave => true
has_and_belongs_to_many :interests, :join_table => 'users_interests', :autosave => true
has_one :avatar
acts_as_tagger