Skip to content

Commit

Permalink
More error validation 2
Browse files Browse the repository at this point in the history
  • Loading branch information
samrund committed May 6, 2015
1 parent 4c16182 commit a0b846a
Show file tree
Hide file tree
Showing 9 changed files with 584 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.generators

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/.rakeTasks

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

195 changes: 195 additions & 0 deletions .idea/redly.iml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

331 changes: 331 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions db/migrate/20150506140714_add_post_type_to_posts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class AddPostTypeToPosts < ActiveRecord::Migration
def up
add_column :posts, :post_type, :integer, default: 0
Post.find_each do |post|
post.post_type = 1 if post.body.present?
post.post_type= 0 if post.link.present?
post.save!
end
end

def down
remove_column :posts, :post_type
end
end

0 comments on commit a0b846a

Please sign in to comment.