README.md in beetle_reporter-0.1.0 vs README.md in beetle_reporter-0.1.1
- old
+ new
@@ -1,39 +1,93 @@
# BeetleReporter
+Short description and motivation.
-Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/beetle_reporter`. To experiment with that code, run `bin/console` for an interactive prompt.
+## Usage
+How to use my plugin.
-TODO: Delete this and the text above, and describe your gem
-
## Installation
-
Add this line to your application's Gemfile:
```ruby
gem 'beetle_reporter'
```
And then execute:
+```bash
+$ bundle
+```
- $ bundle install
-
Or install it yourself as:
+```bash
+$ gem install beetle_reporter
+```
- $ gem install beetle_reporter
+路由
+```ruby
+mount BeetleReporter::Engine => "/beetle_reporter", as: "beetle_reporter"
+```
-## Usage
+初始化配置
+```ruby
+BeetleReporter.configure do |config|
+ config.user_class = 'Admin'
+ config.user_name_method = 'username'
-TODO: Write usage instructions here
+ config.main_app_root_path_method = 'admins_user_root_path'
+ config.main_app_user_path_method = 'admins_user_path'
+end
+```
-## Development
+实现hook方法
+```ruby
+class Diary
+ def beetle_record_path
+ Rails.application.routes.url_helpers.admins_diary_path(id)
+ end
-After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
+ def beetle_hide
+ update_columns(is_approved: false)
+ end
-To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
+ def beetle_undo_hide
+ update_columns(is_approved: true)
+ end
-## Contributing
+ def beetle_remove
+ discard
+ end
-Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/beetle_reporter.
+ def beetle_undo_remove
+ undiscard
+ end
-## License
+ def beetle_mute
+ true
+ end
+ def beetle_undo_mute
+ true
+ end
+
+ def beetle_forbid
+ true
+ end
+
+ def beetle_undo_forbid
+ true
+ end
+
+ def beetle_images
+ pictures.map{|pic| {src: pic.full_url} }
+ end
+end
+```
+
+## 约定
++ 支持 `is_approved` 字段
++ 支持 `discard` 软删 gem
+
+## Contributing
+Contribution directions go here.
+
+## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).