Skip to content

Commit

Permalink
#99 getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaHany94 committed May 1, 2015
1 parent 1c61ef6 commit 780cf49
Show file tree
Hide file tree
Showing 14 changed files with 1,886 additions and 33 deletions.
3 changes: 1 addition & 2 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
---
BUNDLE_DISABLE_SHARED_GEMS: '1'
--- {}
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ gem 'social-share-button'
gem 'carrierwave'
gem 'mini_magick'

gem 'tzinfo-data'
gem 'coffee-script-source', '1.8.0'

gem 'acts-as-taggable-on', '~> 3.4'
gem 'cancan'

Expand Down
62 changes: 32 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ GEM
acts_as_follower (0.2.1)
arel (6.0.0)
bcrypt (3.1.10)
bcrypt (3.1.10-x86-mingw32)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
byebug (3.5.1)
columnize (~> 0.8)
debugger-linecache (~> 1.2)
slop (~> 3.6)
byebug (4.0.5)
columnize (= 0.9.0)
cancan (1.6.10)
carrierwave (0.10.0)
activemodel (>= 3.2.0)
Expand All @@ -65,13 +64,12 @@ GEM
coffee-rails (4.1.0)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1)
coffee-script-source (1.8.0)
columnize (0.9.0)
debug_inspector (0.0.2)
debugger-linecache (1.2.0)
devise (3.4.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
Expand All @@ -82,19 +80,18 @@ GEM
diff-lcs (1.2.5)
docile (1.1.5)
erubis (2.7.0)
execjs (2.4.0)
execjs (2.5.2)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
factory_girl_rails (4.5.0)
factory_girl (~> 4.5.0)
railties (>= 3.0.0)
font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0)
globalid (0.3.3)
globalid (0.3.5)
activesupport (>= 4.1.0)
hike (1.2.3)
i18n (0.7.0)
jbuilder (2.2.11)
jbuilder (2.2.13)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jquery-rails (4.0.3)
Expand All @@ -106,13 +103,15 @@ GEM
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.4.3)
mini_magick (4.1.0)
mime-types (2.5)
mini_magick (4.2.3)
mini_portile (0.6.2)
minitest (5.5.1)
minitest (5.6.1)
multi_json (1.11.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
nokogiri (1.6.6.2-x86-mingw32)
mini_portile (~> 0.6.0)
orm_adapter (0.5.0)
rack (1.6.0)
rack-test (0.6.3)
Expand All @@ -130,11 +129,11 @@ GEM
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.5)
rails-dom-testing (1.0.6)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.1)
rails-html-sanitizer (1.0.2)
loofah (~> 2.0)
railties (4.2.0)
actionpack (= 4.2.0)
Expand All @@ -143,13 +142,14 @@ GEM
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
rdoc (4.2.0)
json (~> 1.4)
redactor-rails (0.5.0)
devise
mime-types
orm_adapter
responders (2.1.0)
railties (>= 4.2.0, < 5)
rspec-core (3.2.2)
rspec-core (3.2.3)
rspec-support (~> 3.2.0)
rspec-expectations (3.2.1)
diff-lcs (>= 1.2.0, < 2.0)
Expand All @@ -167,7 +167,7 @@ GEM
rspec-support (~> 3.2.0)
rspec-support (3.2.2)
sass (3.4.13)
sass-rails (5.0.1)
sass-rails (5.0.3)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
Expand All @@ -176,28 +176,25 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
simplecov (0.9.2)
simplecov (0.10.0)
docile (~> 1.1.0)
multi_json (~> 1.0)
simplecov-html (~> 0.9.0)
simplecov-html (0.9.0)
slop (3.6.0)
json (~> 1.8)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
social-share-button (0.1.8)
coffee-rails
sass-rails
spring (1.3.3)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
spring (1.3.5)
sprockets (3.0.3)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.2.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
sqlite3 (1.3.10)
sqlite3 (1.3.10-x86-mingw32)
thor (0.19.1)
thread_safe (0.3.4)
thread_safe (0.3.5)
tilt (1.4.1)
turbolinks (2.5.3)
coffee-rails
Expand All @@ -208,19 +205,22 @@ GEM
railties (~> 4.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
tzinfo-data (1.2015.4)
tzinfo (>= 1.0.0)
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
warden (1.2.3)
rack (>= 1.0)
web-console (2.1.1)
web-console (2.1.2)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
ruby
x86-mingw32

DEPENDENCIES
acts-as-taggable-on (~> 3.4)
Expand All @@ -230,6 +230,7 @@ DEPENDENCIES
cancan
carrierwave
coffee-rails (~> 4.1.0)
coffee-script-source (= 1.8.0)
devise
factory_girl_rails
font-awesome-rails
Expand All @@ -247,5 +248,6 @@ DEPENDENCIES
sqlite3
turbolinks
twitter-bootstrap-rails
tzinfo-data
uglifier (>= 1.3.0)
web-console (~> 2.0)
4 changes: 4 additions & 0 deletions app/controllers/replies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def edit
def new
end

def report

end

def reply_params
params.require(:reply).permit(:user_id, :article_id, :comment_id, :des)
end
Expand Down
3 changes: 3 additions & 0 deletions app/models/reply.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class Reply < ActiveRecord::Base
# A many-to-many relationship between reply and user
has_many :reportreplies
has_many :users, through: :reportreplies
# A Reply belongs to a comment and have a field for description

belongs_to :comment
Expand Down
4 changes: 4 additions & 0 deletions app/models/reportreply.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Reportreply < ActiveRecord::Base
belongs_to :user
belongs_to :reply
end
3 changes: 3 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# User Model
class User < ActiveRecord::Base
# A many-to-many relationship between reply and user
has_many :reportreplies
has_many :replies, through: :reportreplies
# to upload avatar for user
mount_uploader :avatar, AvatarUploader
# Adds the Abilitiy To follow and be followed
Expand Down
Binary file modified db/development.sqlite3
Binary file not shown.
12 changes: 12 additions & 0 deletions db/migrate/20150501111244_create_reportreplies.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class CreateReportreplies < ActiveRecord::Migration
def change
create_table :reportreplies do |t|
t.references :user, index: true
t.references :reply, index: true

t.timestamps null: false
end
add_foreign_key :reportreplies, :users
add_foreign_key :reportreplies, :replies
end
end
12 changes: 11 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150428220446) do
ActiveRecord::Schema.define(version: 20150501111244) do

create_table "ads", force: :cascade do |t|
t.integer "user_id"
Expand Down Expand Up @@ -114,6 +114,16 @@
t.datetime "updated_at", null: false
end

create_table "reportreplies", force: :cascade do |t|
t.integer "user_id"
t.integer "reply_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

add_index "reportreplies", ["reply_id"], name: "index_reportreplies_on_reply_id"
add_index "reportreplies", ["user_id"], name: "index_reportreplies_on_user_id"

create_table "taggings", force: :cascade do |t|
t.integer "tag_id"
t.integer "taggable_id"
Expand Down
Loading

0 comments on commit 780cf49

Please sign in to comment.