Skip to content

Commit 6797f77

Browse files
committed
more fixes
1 parent c16c395 commit 6797f77

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

app/models/endorsement.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#
1313

1414
class Endorsement < ActiveRecord::Base
15-
belongs_to :endorsed, class_name: User.name, foreign_key: :endorsed_user_id, counter_cache: :endorsements_count, touch: true
16-
belongs_to :endorser, class_name: User.name, foreign_key: :endorsing_user_id
17-
belongs_to :skill, counter_cache: :endorsements_count, touch: :updated_at
15+
belongs_to :endorsed, class_name: 'User', foreign_key: :endorsed_user_id, counter_cache: :endorsements_count, touch: true
16+
belongs_to :endorser, class_name: 'User', foreign_key: :endorsing_user_id
17+
belongs_to :skill, counter_cache: :endorsements_count, touch: true
1818

1919
validates_presence_of :skill_id
2020
validates_presence_of :endorser

app/models/opportunity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Opportunity < ActiveRecord::Base
3737

3838
OPPORTUNITY_TYPES = %w(full-time part-time contract internship)
3939

40-
has_many :seized_opportunities, :delete_all
40+
has_many :seized_opportunities, dependent: :delete_all
4141

4242
# Order here dictates the order of validation error messages displayed in views.
4343
validates :name, presence: true, allow_blank: false

app/models/seized_opportunity.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
#
1414

1515
class SeizedOpportunity < ActiveRecord::Base
16+
belongs_to :opportunity
1617
end

db/schema.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20150110140000) do
14+
ActiveRecord::Schema.define(:version => 20150504132134) do
1515

16+
add_extension "uuid-ossp"
1617
add_extension "citext"
1718
add_extension "hstore"
1819

@@ -53,6 +54,11 @@
5354
t.datetime "created_at"
5455
t.datetime "updated_at"
5556
t.integer "likes_count", :default => 0
57+
t.string "user_name"
58+
t.string "user_email"
59+
t.string "user_agent"
60+
t.inet "user_ip"
61+
t.string "request_format"
5662
end
5763

5864
add_index "comments", ["commentable_id"], :name => "index_comments_on_commentable_id"
@@ -250,7 +256,11 @@
250256
t.float "boost_factor", :default => 1.0
251257
t.integer "inappropriate", :default => 0
252258
t.integer "likes_count", :default => 0
253-
t.string "slug"
259+
t.string "slug", :null => false
260+
t.string "user_name"
261+
t.string "user_email"
262+
t.string "user_agent"
263+
t.inet "user_ip"
254264
end
255265

256266
add_index "protips", ["public_id"], :name => "index_protips_on_public_id"

0 commit comments

Comments
 (0)