chili 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +7 -7
- data/README.md +33 -28
- data/Rakefile +1 -1
- data/app/controllers/chili/application_controller.rb +3 -3
- data/chili.gemspec +3 -3
- data/lib/chili.rb +5 -3
- data/lib/chili/feature.rb +15 -0
- data/lib/chili/version.rb +1 -1
- data/lib/generators/chili/feature/USAGE +8 -0
- data/lib/generators/chili/{extension_generator.rb → feature/feature_generator.rb} +36 -37
- data/lib/generators/chili/generator_proxy.rb +20 -0
- data/spec/dummy/app/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/config/application.rb +14 -0
- data/spec/dummy/{example_app → app}/config/boot.rb +1 -2
- data/spec/dummy/{example_app → app}/config/database.yml +0 -0
- data/spec/dummy/{example_app → app}/config/environment.rb +0 -0
- data/spec/dummy/{example_app → app}/config/environments/development.rb +0 -0
- data/spec/dummy/{example_app → app}/config/environments/test.rb +0 -0
- data/spec/dummy/{example_app → app}/script/rails +0 -0
- data/spec/dummy/{blank_extension → blank_feature}/MIT-LICENSE +0 -0
- data/spec/dummy/blank_feature/README.rdoc +3 -0
- data/spec/dummy/{blank_extension/app/assets/images/blank_extension → blank_feature/app/assets/images/blank_feature}/.gitkeep +0 -0
- data/spec/dummy/{blank_extension/app/assets/javascripts/blank_extension → blank_feature/app/assets/javascripts/blank_feature}/application.js +0 -0
- data/spec/dummy/{blank_extension/app/assets/stylesheets/blank_extension → blank_feature/app/assets/stylesheets/blank_feature}/application.css +0 -0
- data/spec/dummy/blank_feature/app/controllers/blank_feature/application_controller.rb +4 -0
- data/spec/dummy/blank_feature/app/overrides/layouts/application/assets.html.erb.deface +3 -0
- data/spec/dummy/{blank_extension → blank_feature}/app/overrides/layouts/application/example.html.erb.deface +2 -2
- data/spec/dummy/{blank_extension/blank_extension.gemspec → blank_feature/blank_feature.gemspec} +6 -6
- data/spec/dummy/blank_feature/config/routes.rb +3 -0
- data/spec/dummy/blank_feature/lib/blank_feature.rb +7 -0
- data/spec/dummy/blank_feature/lib/blank_feature/engine.rb +5 -0
- data/spec/dummy/{blank_extension/lib/blank_extension → blank_feature/lib/blank_feature}/version.rb +1 -1
- data/spec/dummy/blank_feature/lib/generators/blank_feature_generator.rb +3 -0
- data/spec/dummy/{blank_extension/lib/tasks/blank_extension_tasks.rake → blank_feature/lib/tasks/blank_feature_tasks.rake} +1 -1
- data/spec/{dummy/example_app → example_app}/README.rdoc +0 -0
- data/spec/{dummy/example_app → example_app}/Rakefile +0 -0
- data/spec/{dummy/example_app → example_app}/app/assets/javascripts/application.js +0 -0
- data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/application.css +0 -0
- data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/posts.css +0 -0
- data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/scaffold.css +0 -0
- data/spec/{dummy/example_app → example_app}/app/assets/stylesheets/users.css +0 -0
- data/spec/{dummy/example_app → example_app}/app/controllers/application_controller.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/controllers/posts_controller.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/controllers/sessions_controller.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/controllers/users_controller.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/helpers/application_helper.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/helpers/posts_helper.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/helpers/users_helper.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/mailers/.gitkeep +0 -0
- data/spec/{dummy/example_app → example_app}/app/models/.gitkeep +0 -0
- data/spec/{dummy/example_app → example_app}/app/models/post.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/models/user.rb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/layouts/application.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/posts/_form.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/posts/_post.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/posts/edit.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/posts/index.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/posts/new.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/posts/show.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/sessions/new.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/users/_form.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/users/edit.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/users/index.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/users/new.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/app/views/users/show.html.erb +0 -0
- data/spec/{dummy/example_app → example_app}/config.ru +0 -0
- data/spec/{dummy/example_app → example_app}/config/application.rb +2 -2
- data/spec/example_app/config/boot.rb +12 -0
- data/spec/example_app/config/database.yml +25 -0
- data/spec/example_app/config/environment.rb +5 -0
- data/spec/example_app/config/environments/development.rb +37 -0
- data/spec/{dummy/example_app → example_app}/config/environments/production.rb +0 -0
- data/spec/example_app/config/environments/test.rb +37 -0
- data/spec/{dummy/example_app → example_app}/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/{dummy/example_app → example_app}/config/initializers/inflections.rb +0 -0
- data/spec/{dummy/example_app → example_app}/config/initializers/mime_types.rb +0 -0
- data/spec/{dummy/example_app → example_app}/config/initializers/secret_token.rb +0 -0
- data/spec/{dummy/example_app → example_app}/config/initializers/session_store.rb +0 -0
- data/spec/{dummy/example_app → example_app}/config/initializers/wrap_parameters.rb +0 -0
- data/spec/{dummy/example_app → example_app}/config/locales/en.yml +0 -0
- data/spec/{dummy/example_app → example_app}/config/routes.rb +0 -0
- data/spec/{dummy/example_app → example_app}/db/migrate/20120513023816_create_posts.rb +0 -0
- data/spec/{dummy/example_app → example_app}/db/migrate/20120513023840_create_users.rb +0 -0
- data/spec/example_app/db/migrate/20120513032032_create_social_feature_likes.rb +11 -0
- data/spec/{dummy/example_app → example_app}/db/schema.rb +1 -1
- data/spec/{dummy/example_app → example_app}/lib/assets/.gitkeep +0 -0
- data/spec/{dummy/example_app/vendor/chili/invites_extension → example_app/lib/chili/invites_feature}/.gitignore +0 -0
- data/spec/{dummy/example_app/log → example_app/lib/chili/invites_feature/app/assets/images/invites_feature}/.gitkeep +0 -0
- data/spec/{dummy/example_app/vendor/chili/invites_extension/app/assets/javascripts/invites_extension → example_app/lib/chili/invites_feature/app/assets/javascripts/invites_feature}/application.js +0 -0
- data/spec/{dummy/example_app/vendor/chili/invites_extension/app/assets/stylesheets/invites_extension → example_app/lib/chili/invites_feature/app/assets/stylesheets/invites_feature}/application.css +0 -0
- data/spec/example_app/lib/chili/invites_feature/app/controllers/invites_feature/application_controller.rb +4 -0
- data/spec/{dummy/example_app/vendor/chili/invites_extension → example_app/lib/chili/invites_feature}/app/overrides/posts/index/disclaimer.html.erb.deface +0 -0
- data/spec/example_app/lib/chili/invites_feature/config/routes.rb +3 -0
- data/spec/example_app/lib/chili/invites_feature/lib/generators/invites_feature_generator.rb +3 -0
- data/spec/{dummy/example_app/vendor/chili/invites_extension/lib/invites_extension.rb → example_app/lib/chili/invites_feature/lib/invites_feature.rb} +2 -2
- data/spec/example_app/lib/chili/invites_feature/lib/invites_feature/engine.rb +5 -0
- data/spec/{dummy/example_app/vendor/chili/invites_extension/app/assets/images/invites_extension → example_app/lib/chili/social_feature/app/assets/images/social_feature}/.gitkeep +0 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/assets/javascripts/social_extension → example_app/lib/chili/social_feature/app/assets/javascripts/social_feature}/application.js +0 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/assets/stylesheets/social_extension → example_app/lib/chili/social_feature/app/assets/stylesheets/social_feature}/application.css.scss +0 -0
- data/spec/example_app/lib/chili/social_feature/app/controllers/social_feature/application_controller.rb +4 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/controllers/social_extension → example_app/lib/chili/social_feature/app/controllers/social_feature}/likes_controller.rb +3 -3
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/models/social_extension → example_app/lib/chili/social_feature/app/models/social_feature}/like.rb +1 -1
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/models/social_extension → example_app/lib/chili/social_feature/app/models/social_feature}/post.rb +1 -1
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/models/social_extension → example_app/lib/chili/social_feature/app/models/social_feature}/user.rb +1 -1
- data/spec/example_app/lib/chili/social_feature/app/overrides/layouts/application/likes_link.html.erb.deface +2 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension → example_app/lib/chili/social_feature}/app/overrides/posts/_post/like_actions.html.erb.deface +2 -2
- data/spec/{dummy/example_app/vendor/chili/social_extension → example_app/lib/chili/social_feature}/app/overrides/posts/index/disclaimer.html.erb.deface +0 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension → example_app/lib/chili/social_feature}/app/overrides/posts/index/table_headers.html.erb.deface +0 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/views/social_extension → example_app/lib/chili/social_feature/app/views/social_feature}/likes/index.html.erb +0 -0
- data/spec/example_app/lib/chili/social_feature/config/routes.rb +4 -0
- data/spec/example_app/lib/chili/social_feature/db/migrate/20120513031021_create_social_feature_likes.rb +10 -0
- data/spec/example_app/lib/chili/social_feature/lib/generators/social_feature_generator.rb +3 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension/lib/social_extension.rb → example_app/lib/chili/social_feature/lib/social_feature.rb} +2 -2
- data/spec/example_app/lib/chili/social_feature/lib/social_feature/engine.rb +5 -0
- data/spec/{dummy/example_app/vendor/chili/social_extension/app/assets/images/social_extension → example_app/log}/.gitkeep +0 -0
- data/spec/{dummy/example_app → example_app}/public/404.html +0 -0
- data/spec/{dummy/example_app → example_app}/public/422.html +0 -0
- data/spec/{dummy/example_app → example_app}/public/500.html +0 -0
- data/spec/{dummy/example_app → example_app}/public/favicon.ico +0 -0
- data/spec/example_app/script/rails +6 -0
- data/spec/{dummy/example_app → example_app}/spec/support/user_macros.rb +0 -0
- data/spec/generators/chili/feature_generator_spec.rb +40 -0
- data/spec/generators/chili/generator_proxy_spec.rb +28 -0
- data/spec/requests/social_extension_spec.rb +5 -5
- data/spec/spec_helper.rb +2 -1
- data/spec/support/dummy_app.rb +21 -0
- metadata +251 -256
- data/lib/generators/chili/USAGE +0 -8
- data/lib/generators/rails/chili_generator.rb +0 -11
- data/lib/generators/rails/templates/controller.rb +0 -73
- data/spec/dummy/blank_extension/README.rdoc +0 -3
- data/spec/dummy/blank_extension/app/overrides/layouts/application/assets.html.erb.deface +0 -3
- data/spec/dummy/blank_extension/config/routes.rb +0 -3
- data/spec/dummy/blank_extension/lib/blank_extension.rb +0 -7
- data/spec/dummy/blank_extension/lib/blank_extension/engine.rb +0 -10
- data/spec/dummy/blank_extension/script/rails +0 -8
- data/spec/dummy/example_app/db/migrate/20120513032032_create_social_extension_likes.rb +0 -11
- data/spec/dummy/example_app/vendor/chili/invites_extension/config/routes.rb +0 -3
- data/spec/dummy/example_app/vendor/chili/invites_extension/lib/invites_extension/engine.rb +0 -10
- data/spec/dummy/example_app/vendor/chili/social_extension/app/overrides/layouts/application/likes_link.html.erb.deface +0 -2
- data/spec/dummy/example_app/vendor/chili/social_extension/config/routes.rb +0 -4
- data/spec/dummy/example_app/vendor/chili/social_extension/db/migrate/20120513031021_create_likes_extension_likes.rb +0 -10
- data/spec/dummy/example_app/vendor/chili/social_extension/lib/social_extension/engine.rb +0 -10
- data/spec/generators/chili/chili_generator_spec.rb +0 -53
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- insert_bottom 'body' -->
|
|
2
2
|
<div style='background: #FFF;text-align: center; padding: 4px 0;position: fixed;width: 100%;z-index: 9999;top: 0;'>
|
|
3
|
-
|
|
4
|
-
<strong>
|
|
3
|
+
blank_feature active - edit/remove this file:<br/>
|
|
4
|
+
<strong>lib/chili/blank_feature/app/overrides/layouts/application/example.html.erb.deface</strong><br/>
|
|
5
5
|
<%= link_to 'deface docs', 'https://github.com/spree/deface', target: '_blank' %>
|
|
6
6
|
</div>
|
data/spec/dummy/{blank_extension/blank_extension.gemspec → blank_feature/blank_feature.gemspec}
RENAMED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
$:.push File.expand_path("../lib", __FILE__)
|
|
2
2
|
|
|
3
3
|
# Maintain your gem's version:
|
|
4
|
-
require "
|
|
4
|
+
require "blank_feature/version"
|
|
5
5
|
|
|
6
6
|
# Describe your gem and declare its dependencies:
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
|
-
s.name = "
|
|
9
|
-
s.version =
|
|
8
|
+
s.name = "blank_feature"
|
|
9
|
+
s.version = BlankFeature::VERSION
|
|
10
10
|
s.authors = ["GIT_AUTHOR"]
|
|
11
11
|
s.email = ["GIT_EMAIL"]
|
|
12
12
|
s.homepage = ""
|
|
13
|
-
s.summary = "Summary of
|
|
14
|
-
s.description = "Description of
|
|
13
|
+
s.summary = "Summary of BlankFeature."
|
|
14
|
+
s.description = "Description of BlankFeature."
|
|
15
15
|
|
|
16
16
|
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
|
|
17
17
|
|
|
18
18
|
s.add_dependency "rails", "~> 3.2.8"
|
|
19
|
-
s.add_dependency 'chili', '~>
|
|
19
|
+
s.add_dependency 'chili', '~> 2.0'
|
|
20
20
|
|
|
21
21
|
s.add_development_dependency "sqlite3"
|
|
22
22
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
gemfile = File.expand_path('../../../../../Gemfile', __FILE__)
|
|
3
|
+
|
|
4
|
+
if File.exist?(gemfile)
|
|
5
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
|
6
|
+
require 'bundler'
|
|
7
|
+
Bundler.setup
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
$:.unshift File.expand_path('../../../../../lib', __FILE__)
|
|
11
|
+
$:.unshift File.expand_path('../../lib/chili/social_feature/lib', __FILE__)
|
|
12
|
+
$:.unshift File.expand_path('../../lib/chili/invites_feature/lib', __FILE__)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# SQLite version 3.x
|
|
2
|
+
# gem install sqlite3
|
|
3
|
+
#
|
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
|
5
|
+
# gem 'sqlite3'
|
|
6
|
+
development:
|
|
7
|
+
adapter: sqlite3
|
|
8
|
+
database: db/development.sqlite3
|
|
9
|
+
pool: 5
|
|
10
|
+
timeout: 5000
|
|
11
|
+
|
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
|
13
|
+
# re-generated from your development database when you run "rake".
|
|
14
|
+
# Do not set this db to the same as development or production.
|
|
15
|
+
test:
|
|
16
|
+
adapter: sqlite3
|
|
17
|
+
database: db/test.sqlite3
|
|
18
|
+
pool: 5
|
|
19
|
+
timeout: 5000
|
|
20
|
+
|
|
21
|
+
production:
|
|
22
|
+
adapter: sqlite3
|
|
23
|
+
database: db/production.sqlite3
|
|
24
|
+
pool: 5
|
|
25
|
+
timeout: 5000
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Dummy::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
+
|
|
4
|
+
# In the development environment your application's code is reloaded on
|
|
5
|
+
# every request. This slows down response time but is perfect for development
|
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
|
7
|
+
config.cache_classes = false
|
|
8
|
+
|
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
|
10
|
+
config.whiny_nils = true
|
|
11
|
+
|
|
12
|
+
# Show full error reports and disable caching
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
config.action_controller.perform_caching = false
|
|
15
|
+
|
|
16
|
+
# Don't care if the mailer can't send
|
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
|
18
|
+
|
|
19
|
+
# Print deprecation notices to the Rails logger
|
|
20
|
+
config.active_support.deprecation = :log
|
|
21
|
+
|
|
22
|
+
# Only use best-standards-support built into browsers
|
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
|
24
|
+
|
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
|
27
|
+
|
|
28
|
+
# Log the query plan for queries taking more than this (works
|
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
|
31
|
+
|
|
32
|
+
# Do not compress assets
|
|
33
|
+
config.assets.compress = false
|
|
34
|
+
|
|
35
|
+
# Expands the lines which load the assets
|
|
36
|
+
config.assets.debug = true
|
|
37
|
+
end
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Dummy::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
+
|
|
4
|
+
# The test environment is used exclusively to run your application's
|
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
+
config.cache_classes = true
|
|
9
|
+
|
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
|
11
|
+
config.serve_static_assets = true
|
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
|
13
|
+
|
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
|
15
|
+
config.whiny_nils = true
|
|
16
|
+
|
|
17
|
+
# Show full error reports and disable caching
|
|
18
|
+
config.consider_all_requests_local = true
|
|
19
|
+
config.action_controller.perform_caching = false
|
|
20
|
+
|
|
21
|
+
# Raise exceptions instead of rendering exception templates
|
|
22
|
+
config.action_dispatch.show_exceptions = false
|
|
23
|
+
|
|
24
|
+
# Disable request forgery protection in test environment
|
|
25
|
+
config.action_controller.allow_forgery_protection = false
|
|
26
|
+
|
|
27
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
|
28
|
+
# The :test delivery method accumulates sent emails in the
|
|
29
|
+
# ActionMailer::Base.deliveries array.
|
|
30
|
+
config.action_mailer.delivery_method = :test
|
|
31
|
+
|
|
32
|
+
# Raise exception on mass assignment protection for Active Record models
|
|
33
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
|
34
|
+
|
|
35
|
+
# Print deprecation notices to the stderr
|
|
36
|
+
config.active_support.deprecation = :stderr
|
|
37
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# This migration comes from social_feature (originally 20120513031021)
|
|
2
|
+
class CreateSocialFeatureLikes < ActiveRecord::Migration
|
|
3
|
+
def change
|
|
4
|
+
create_table :social_feature_likes do |t|
|
|
5
|
+
t.integer :post_id
|
|
6
|
+
t.integer :user_id
|
|
7
|
+
|
|
8
|
+
t.timestamps
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -19,7 +19,7 @@ ActiveRecord::Schema.define(:version => 20120513032032) do
|
|
|
19
19
|
t.datetime "updated_at", :null => false
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
create_table "
|
|
22
|
+
create_table "social_feature_likes", :force => true do |t|
|
|
23
23
|
t.integer "post_id"
|
|
24
24
|
t.integer "user_id"
|
|
25
25
|
t.datetime "created_at", :null => false
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module
|
|
2
|
-
class LikesController <
|
|
1
|
+
module SocialFeature
|
|
2
|
+
class LikesController < ApplicationController
|
|
3
3
|
|
|
4
4
|
def index
|
|
5
5
|
@likes = current_user.likes
|
|
@@ -13,7 +13,7 @@ module SocialExtension
|
|
|
13
13
|
private
|
|
14
14
|
|
|
15
15
|
def current_user
|
|
16
|
-
super.becomes(
|
|
16
|
+
super.becomes(SocialFeature::User)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- insert_bottom 'tr' -->
|
|
2
|
-
<% post.becomes(
|
|
3
|
-
<td><%= link_to 'Like!',
|
|
2
|
+
<% post.becomes(SocialFeature::Post).tap do |post| %>
|
|
3
|
+
<td><%= link_to 'Like!', social_feature.likes_path(like: {post_id: post}), method: :post %></td>
|
|
4
4
|
<td><%= pluralize post.likes.size, 'like' %></td>
|
|
5
5
|
<td class='remark'><%= post.well_liked? ? 'This post is well liked!' : 'This post is boring...' %></td>
|
|
6
6
|
<% end %>
|