File tree 5 files changed +49
-20
lines changed
5 files changed +49
-20
lines changed Original file line number Diff line number Diff line change 1
- # ----------------------------------------------------------------------------
2
- # Ignore these files when commiting to a git repository.
3
- #
4
- # See http://help.github.com/ignore-files/ for more about ignoring files.
5
- #
6
- # The original version of this file is found here:
7
- # https://github.com/RailsApps/rails-composer/blob/master/files/gitignore.txt
8
- #
9
- # Corrections? Improvements? Create a GitHub issue:
10
- # http://github.com/RailsApps/rails-composer/issues
11
- # ----------------------------------------------------------------------------
12
-
13
1
# bundler state
14
2
/.bundle
15
3
/vendor /bundle /
@@ -28,7 +16,6 @@ db/*.sqlite3
28
16
.redcar /
29
17
.sass-cache
30
18
/config /config.yml
31
- /config /database.yml
32
19
/coverage.data
33
20
/coverage /
34
21
/db /* .javadb /
Original file line number Diff line number Diff line change @@ -7,10 +7,19 @@ This is a simple app using the Interactor gem.
7
7
8
8
### What does this app do ?
9
9
10
- * Use interactors in order to handle the new comment
11
- * One interactor to actually store the comment
12
- * One to send a ThankYou message to the commenter (not really send anything)
13
- * One to log the event through a Mixpanel kind of app (not really logging anything)
14
- * Show an example of a rollback, just check the box before adding a comment
15
- * Show an example of hook usage
16
- * The code also contains some test best practices
10
+ * [x] Use interactors in order to handle the new comment
11
+ * [x] One interactor to actually store the comment
12
+ * [x] One to send a ThankYou message to the commenter (not really send anything)
13
+ * [x] One to log the event through a Mixpanel kind of app (not really logging anything)
14
+ * [x] Show an example of a rollback, just check the box before adding a comment
15
+ * [x] Show an example of hook usage
16
+ * [ ] Show an example with multiple hooks
17
+ * [ ] The code also contains some test best practices
18
+
19
+ ### Setting up the app
20
+
21
+ ```
22
+ $> [email protected] :beNjiox/interactor-sample.git
23
+ $> cd interactor-sample
24
+ $> rake db:migrate
25
+ ```
Original file line number Diff line number Diff line change @@ -3,5 +3,7 @@ class LogComment
3
3
4
4
def call
5
5
Rails . logger . info '#3 - LogComment'
6
+ # Here you can for example invoke the Mixpanel API to log your event
7
+ # Mixpanel::Tracker.new(ENV['MIXPANEL_PROJECT_TOKEN']).track(context.comment.email, 'A user commented the GuestBook')
6
8
end
7
9
end
Original file line number Diff line number Diff line change 5
5
if context . fake_fail == true
6
6
context . fail! ( :message => 'You checked the fake fail checkbox... we can\'t continue!' )
7
7
else
8
+ # Here you can send a email to the commenter
9
+ # CommenterMailer.thank_you_email(context.comment.email)
8
10
Rails . logger . info '#2 - SendThankYou'
9
11
end
10
12
end
Original file line number Diff line number Diff line change
1
+ development :
2
+ adapter : postgresql
3
+ host : localhost
4
+ encoding : unicode
5
+ database : interactor-sample_development
6
+ pool : 5
7
+ username : interactor-sample
8
+ password :
9
+ template : template0
10
+
11
+ test :
12
+ adapter : postgresql
13
+ host : localhost
14
+ encoding : unicode
15
+ database : interactor-sample_test
16
+ pool : 5
17
+ username : interactor-sample
18
+ password :
19
+ template : template0
20
+
21
+ production :
22
+ adapter : postgresql
23
+ host : localhost
24
+ encoding : unicode
25
+ database : interactor-sample_production
26
+ pool : 5
27
+ username : interactor-sample
28
+ password :
29
+ template : template0
You can’t perform that action at this time.
0 commit comments