Skip to content

Commit

Permalink
modelos anotados
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjcsr committed Jun 9, 2014
1 parent e9a83a1 commit e01454f
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 10 deletions.
21 changes: 21 additions & 0 deletions app/models/accion.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# == Schema Information
#
# Table name: acciones
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# points :integer
# created_at :datetime
# updated_at :datetime
# level :integer default(1)
# canjeable :boolean default(FALSE)
# code :string(255)
# lugar :string(255)
# promotor :string(255)
# recurrente :boolean
# fecha :string(255)
# horario :string(255)
# url :string(255)
#

class Accion< ActiveRecord::Base
validates :points, presence: true

Expand Down
12 changes: 12 additions & 0 deletions app/models/badge.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: badges
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# points :integer
# created_at :datetime
# updated_at :datetime
#

class Badge < ActiveRecord::Base

has_many :badge_relationships, foreign_key: "badge_id", dependent: :destroy
Expand Down
11 changes: 11 additions & 0 deletions app/models/badge_relationship.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: badge_relationships
#
# id :integer not null, primary key
# user_id :integer
# badge_id :integer
# created_at :datetime
# updated_at :datetime
#

class BadgeRelationship < ActiveRecord::Base
belongs_to :badge
belongs_to :user
Expand Down
11 changes: 11 additions & 0 deletions app/models/friend_relationship.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: friend_relationships
#
# id :integer not null, primary key
# follower_id :integer
# followed_id :integer
# created_at :datetime
# updated_at :datetime
#

class FriendRelationship < ActiveRecord::Base

belongs_to :follower, class_name: "User"
Expand Down
12 changes: 12 additions & 0 deletions app/models/relationship.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: relationships
#
# id :integer not null, primary key
# user_id :integer
# accion_id :integer
# created_at :datetime
# updated_at :datetime
# completed :boolean default(FALSE)
#

class Relationship < ActiveRecord::Base
belongs_to :user, class_name: "User"
belongs_to :accion, class_name: "Accion"
Expand Down
29 changes: 29 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# reset_password_token :string(255)
# reset_password_sent_at :datetime
# remember_created_at :datetime
# sign_in_count :integer default(0), not null
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# current_sign_in_ip :string(255)
# last_sign_in_ip :string(255)
# created_at :datetime
# updated_at :datetime
# first_name :string(255)
# last_name :string(255)
# points :integer default(0)
# level :integer default(1)
# provider :string(255)
# uid :string(255)
# access_token_fb :string(255)
# access_token_tw :string(255)
# access_token_gp :string(255)
# admin :boolean default(FALSE)
#

class User < ActiveRecord::Base

# Include default devise modules. Others available are:
Expand Down
13 changes: 8 additions & 5 deletions app/views/shared/_action_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
%p
= accion.desc
.portlet-footer
Esta acción vale:
= accion.points
puntos //
Promotor:
=accion.promotor
.bottom-container
.participa-container
%a.btn.btn-xs.btn-purple{href: accion_path(accion)}
Participa
.puntos-container
=accion.points
puntos


21 changes: 21 additions & 0 deletions spec/models/accion_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# == Schema Information
#
# Table name: acciones
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# points :integer
# created_at :datetime
# updated_at :datetime
# level :integer default(1)
# canjeable :boolean default(FALSE)
# code :string(255)
# lugar :string(255)
# promotor :string(255)
# recurrente :boolean
# fecha :string(255)
# horario :string(255)
# url :string(255)
#

require 'spec_helper'

describe Accion do
Expand Down
11 changes: 11 additions & 0 deletions spec/models/badge_relationship_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: badge_relationships
#
# id :integer not null, primary key
# user_id :integer
# badge_id :integer
# created_at :datetime
# updated_at :datetime
#

require 'spec_helper'

describe BadgeRelationship do
Expand Down
12 changes: 12 additions & 0 deletions spec/models/badge_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: badges
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# points :integer
# created_at :datetime
# updated_at :datetime
#

require 'spec_helper'

describe Badge do
Expand Down
11 changes: 11 additions & 0 deletions spec/models/friend_relationship_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: friend_relationships
#
# id :integer not null, primary key
# follower_id :integer
# followed_id :integer
# created_at :datetime
# updated_at :datetime
#

require 'spec_helper'

describe FriendRelationship do
Expand Down
12 changes: 12 additions & 0 deletions spec/models/relationship_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: relationships
#
# id :integer not null, primary key
# user_id :integer
# accion_id :integer
# created_at :datetime
# updated_at :datetime
# completed :boolean default(FALSE)
#

require 'spec_helper'

describe Relationship do
Expand Down
29 changes: 29 additions & 0 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# email :string(255) default(""), not null
# encrypted_password :string(255) default(""), not null
# reset_password_token :string(255)
# reset_password_sent_at :datetime
# remember_created_at :datetime
# sign_in_count :integer default(0), not null
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# current_sign_in_ip :string(255)
# last_sign_in_ip :string(255)
# created_at :datetime
# updated_at :datetime
# first_name :string(255)
# last_name :string(255)
# points :integer default(0)
# level :integer default(1)
# provider :string(255)
# uid :string(255)
# access_token_fb :string(255)
# access_token_tw :string(255)
# access_token_gp :string(255)
# admin :boolean default(FALSE)
#

require 'spec_helper'

describe User do
Expand Down
18 changes: 13 additions & 5 deletions vendor/assets/stylesheets/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ a:focus {
margin: 50px 0 0 225px;
padding: 0 30px;
/* min-height: 1300px; */
border-left: 1px solid #2c3e50;
border-left: 1px solid #ffffff ;
}

#page-wrapper.collapsed {
Expand Down Expand Up @@ -200,7 +200,7 @@ a:focus {

.navbar-top {
margin-left: 0;
background-color: #2c3e50;
background-color: #ffffff ;
}

.navbar-top .navbar-brand a {
Expand Down Expand Up @@ -406,7 +406,7 @@ a:focus {
text-align: center;
font-size: 11px;
line-height: 20px;
background-color: #2c3e50;
background-color: #ffffff ;
}

@media(min-width:768px) {
Expand Down Expand Up @@ -612,7 +612,7 @@ a:focus {
}

.navbar-side .side-nav > li > a.active {
background-color: #2c3e50;
background-color: #ffffff ;
}

.navbar-side .side-nav li.panel ul li a.active {
Expand Down Expand Up @@ -885,6 +885,14 @@ a:focus {
}
}

.participa-container {
float: left;
}

.puntos-container {
margin-left: 60%;
}

/* Flex Tile Styles
8888888 8888888888 8 8888 8 8888 8 8888888888 d888888o.
Expand Down Expand Up @@ -1258,7 +1266,7 @@ fieldset[disabled] .btn-purple.active {
.btn-dark-blue.active,
.open .dropdown-toggle.btn-default,
.open .dropdown-toggle.btn-dark-blue {
border-color: #2c3e50;
border-color: #ffffff ;
color: #fff;
background-color: #2f4254;
}
Expand Down

0 comments on commit e01454f

Please sign in to comment.