Skip to content

Commit

Permalink
update create_action
Browse files Browse the repository at this point in the history
  • Loading branch information
FuckLock committed Dec 28, 2017
1 parent 1603fc7 commit 316402a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,9 @@ action_plugin :User, :like, :Post -> generate instance methods:

@post.like_users

@user.like_post?
@user.like_post @post

@user.unlike_post @post

@user.like_post? @post
```
4 changes: 1 addition & 3 deletions action_plugin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rails", "4.2.0, ~> 5"
end
4 changes: 2 additions & 2 deletions db/migrate/create_actions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def change
t.timestamps
end

add_index :actions, %w[subject_id subject_type action_type target_type]
add_index :actions, %w[target_id target_type action_type subject_type]
add_index :actions, %w[subject_id subject_type action_type]
add_index :actions, %w[target_id target_type action_type]
end
end
2 changes: 1 addition & 1 deletion lib/action_plugin/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ActionPlugin
VERSION = "0.1.0"
VERSION = "0.2.0"
end

0 comments on commit 316402a

Please sign in to comment.