impressionist2 1.5.1

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.
Files changed (146) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +13 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +26 -0
  5. data/CHANGELOG.rdoc +82 -0
  6. data/Gemfile +26 -0
  7. data/LICENSE.txt +20 -0
  8. data/README.md +250 -0
  9. data/Rakefile +34 -0
  10. data/app/controllers/impressionist_controller.rb +146 -0
  11. data/app/models/impression.rb +2 -0
  12. data/app/models/impressionist/bots.rb +1468 -0
  13. data/app/models/impressionist/impressionable.rb +62 -0
  14. data/gemfiles/rails32.gemfile +30 -0
  15. data/gemfiles/rails40.gemfile +30 -0
  16. data/gemfiles/rails50.gemfile +30 -0
  17. data/impressionist2.gemspec +23 -0
  18. data/lib/generators/active_record/impressionist_generator.rb +22 -0
  19. data/lib/generators/active_record/templates/create_impressions_table.rb +32 -0
  20. data/lib/generators/impressionist_generator.rb +13 -0
  21. data/lib/generators/mongo_mapper/impressionist_generator.rb +8 -0
  22. data/lib/generators/mongoid/impressionist_generator.rb +8 -0
  23. data/lib/generators/templates/impression.rb +8 -0
  24. data/lib/impressionist/bots.rb +21 -0
  25. data/lib/impressionist/controllers/mongoid/impressionist_controller.rb +10 -0
  26. data/lib/impressionist/counter_cache.rb +73 -0
  27. data/lib/impressionist/engine.rb +30 -0
  28. data/lib/impressionist/is_impressionable.rb +23 -0
  29. data/lib/impressionist/load.rb +11 -0
  30. data/lib/impressionist/models/active_record/impression.rb +14 -0
  31. data/lib/impressionist/models/active_record/impressionist/impressionable.rb +12 -0
  32. data/lib/impressionist/models/mongo_mapper/impression.rb +18 -0
  33. data/lib/impressionist/models/mongo_mapper/impressionist/impressionable.rb +21 -0
  34. data/lib/impressionist/models/mongoid/impression.rb +25 -0
  35. data/lib/impressionist/models/mongoid/impressionist/impressionable.rb +28 -0
  36. data/lib/impressionist/rails_toggle.rb +26 -0
  37. data/lib/impressionist/setup_association.rb +49 -0
  38. data/lib/impressionist/update_counters.rb +69 -0
  39. data/lib/impressionist/version.rb +3 -0
  40. data/lib/impressionist.rb +12 -0
  41. data/logo.png +0 -0
  42. data/tests/README +11 -0
  43. data/tests/spec/minitest_helper.rb +4 -0
  44. data/tests/spec/rails_toggle_spec.rb +38 -0
  45. data/tests/spec/setup_association_spec.rb +56 -0
  46. data/tests/test_app/.gitignore +18 -0
  47. data/tests/test_app/.rspec +1 -0
  48. data/tests/test_app/Gemfile +51 -0
  49. data/tests/test_app/README +256 -0
  50. data/tests/test_app/README.rdoc +261 -0
  51. data/tests/test_app/Rakefile +7 -0
  52. data/tests/test_app/app/assets/images/rails.png +0 -0
  53. data/tests/test_app/app/assets/javascripts/application.js +13 -0
  54. data/tests/test_app/app/assets/stylesheets/application.css +13 -0
  55. data/tests/test_app/app/controllers/application_controller.rb +8 -0
  56. data/tests/test_app/app/controllers/articles_controller.rb +18 -0
  57. data/tests/test_app/app/controllers/dummy_controller.rb +8 -0
  58. data/tests/test_app/app/controllers/posts_controller.rb +23 -0
  59. data/tests/test_app/app/controllers/profiles_controller.rb +14 -0
  60. data/tests/test_app/app/controllers/widgets_controller.rb +12 -0
  61. data/tests/test_app/app/helpers/application_helper.rb +2 -0
  62. data/tests/test_app/app/mailers/.gitkeep +0 -0
  63. data/tests/test_app/app/models/.gitkeep +0 -0
  64. data/tests/test_app/app/models/article.rb +3 -0
  65. data/tests/test_app/app/models/dummy.rb +7 -0
  66. data/tests/test_app/app/models/post.rb +3 -0
  67. data/tests/test_app/app/models/profile.rb +6 -0
  68. data/tests/test_app/app/models/user.rb +3 -0
  69. data/tests/test_app/app/models/widget.rb +3 -0
  70. data/tests/test_app/app/views/articles/index.html.erb +1 -0
  71. data/tests/test_app/app/views/articles/show.html.erb +1 -0
  72. data/tests/test_app/app/views/dummy/index.html.erb +0 -0
  73. data/tests/test_app/app/views/layouts/application.html.erb +14 -0
  74. data/tests/test_app/app/views/posts/edit.html.erb +0 -0
  75. data/tests/test_app/app/views/posts/index.html.erb +0 -0
  76. data/tests/test_app/app/views/posts/show.html.erb +0 -0
  77. data/tests/test_app/app/views/profiles/show.html.erb +3 -0
  78. data/tests/test_app/app/views/widgets/index.html.erb +0 -0
  79. data/tests/test_app/app/views/widgets/new.html.erb +0 -0
  80. data/tests/test_app/app/views/widgets/show.html.erb +0 -0
  81. data/tests/test_app/config/application.rb +59 -0
  82. data/tests/test_app/config/boot.rb +6 -0
  83. data/tests/test_app/config/cucumber.yml +8 -0
  84. data/tests/test_app/config/database.yml +30 -0
  85. data/tests/test_app/config/environment.rb +5 -0
  86. data/tests/test_app/config/environments/development.rb +37 -0
  87. data/tests/test_app/config/environments/pg_test.rb +35 -0
  88. data/tests/test_app/config/environments/production.rb +67 -0
  89. data/tests/test_app/config/environments/test.rb +37 -0
  90. data/tests/test_app/config/initializers/backtrace_silencers.rb +7 -0
  91. data/tests/test_app/config/initializers/impression.rb +8 -0
  92. data/tests/test_app/config/initializers/inflections.rb +15 -0
  93. data/tests/test_app/config/initializers/mime_types.rb +5 -0
  94. data/tests/test_app/config/initializers/secret_token.rb +7 -0
  95. data/tests/test_app/config/initializers/session_store.rb +8 -0
  96. data/tests/test_app/config/initializers/wrap_parameters.rb +14 -0
  97. data/tests/test_app/config/locales/en.yml +5 -0
  98. data/tests/test_app/config/routes.rb +4 -0
  99. data/tests/test_app/config.ru +4 -0
  100. data/tests/test_app/db/migrate/20110201153144_create_articles.rb +13 -0
  101. data/tests/test_app/db/migrate/20110210205028_create_posts.rb +13 -0
  102. data/tests/test_app/db/migrate/20111127184039_create_widgets.rb +15 -0
  103. data/tests/test_app/db/migrate/20130719024021_create_impressions_table.rb +32 -0
  104. data/tests/test_app/db/migrate/20150207135825_create_profiles.rb +10 -0
  105. data/tests/test_app/db/migrate/20150207140310_create_friendly_id_slugs.rb +18 -0
  106. data/tests/test_app/db/schema.rb +80 -0
  107. data/tests/test_app/db/seeds.rb +7 -0
  108. data/tests/test_app/lib/assets/.gitkeep +0 -0
  109. data/tests/test_app/lib/tasks/.gitkeep +0 -0
  110. data/tests/test_app/lib/tasks/cucumber.rake +53 -0
  111. data/tests/test_app/log/.gitkeep +0 -0
  112. data/tests/test_app/public/404.html +26 -0
  113. data/tests/test_app/public/422.html +26 -0
  114. data/tests/test_app/public/500.html +25 -0
  115. data/tests/test_app/public/favicon.ico +0 -0
  116. data/tests/test_app/public/images/rails.png +0 -0
  117. data/tests/test_app/public/index.html +241 -0
  118. data/tests/test_app/public/javascripts/application.js +2 -0
  119. data/tests/test_app/public/javascripts/controls.js +965 -0
  120. data/tests/test_app/public/javascripts/dragdrop.js +974 -0
  121. data/tests/test_app/public/javascripts/effects.js +1123 -0
  122. data/tests/test_app/public/javascripts/prototype.js +6001 -0
  123. data/tests/test_app/public/javascripts/rails.js +175 -0
  124. data/tests/test_app/public/robots.txt +5 -0
  125. data/tests/test_app/public/stylesheets/.gitkeep +0 -0
  126. data/tests/test_app/script/cucumber +10 -0
  127. data/tests/test_app/script/rails +6 -0
  128. data/tests/test_app/spec/controllers/articles_controller_spec.rb +76 -0
  129. data/tests/test_app/spec/controllers/dummy_controller_spec.rb +11 -0
  130. data/tests/test_app/spec/controllers/impressionist_uniqueness_spec.rb +396 -0
  131. data/tests/test_app/spec/controllers/posts_controller_spec.rb +28 -0
  132. data/tests/test_app/spec/controllers/widgets_controller_spec.rb +91 -0
  133. data/tests/test_app/spec/fixtures/articles.yml +3 -0
  134. data/tests/test_app/spec/fixtures/impressions.yml +43 -0
  135. data/tests/test_app/spec/fixtures/posts.yml +3 -0
  136. data/tests/test_app/spec/fixtures/profiles.yml +4 -0
  137. data/tests/test_app/spec/fixtures/widgets.yml +4 -0
  138. data/tests/test_app/spec/initializers/initializers_spec.rb +20 -0
  139. data/tests/test_app/spec/models/bots_spec.rb +27 -0
  140. data/tests/test_app/spec/models/counter_caching_spec.rb +51 -0
  141. data/tests/test_app/spec/models/model_spec.rb +70 -0
  142. data/tests/test_app/spec/rails_generators/rails_generators_spec.rb +23 -0
  143. data/tests/test_app/spec/spec_helper.rb +43 -0
  144. data/upgrade_migrations/version_0_3_0.rb +27 -0
  145. data/upgrade_migrations/version_0_4_0.rb +9 -0
  146. metadata +314 -0
@@ -0,0 +1,35 @@
1
+ TestApp::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
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Tell Action Mailer not to deliver emails to the real world.
24
+ # The :test delivery method accumulates sent emails in the
25
+ # ActionMailer::Base.deliveries array.
26
+ config.action_mailer.delivery_method = :test
27
+
28
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
29
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
30
+ # like if you have constraints or database-specific column types
31
+ # config.active_record.schema_format = :sql
32
+
33
+ # Print deprecation notices to the stderr
34
+ config.active_support.deprecation = :stderr
35
+ end
@@ -0,0 +1,67 @@
1
+ TestApp::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ TestApp::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
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,8 @@
1
+ # Use this hook to configure impressionist parameters
2
+ #Impressionist.setup do |config|
3
+ # Define ORM. Could be :active_record (default), :mongo_mapper or :mongoid
4
+ # config.orm = :active_record
5
+ #end
6
+
7
+
8
+
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ TestApp::Application.config.secret_token = '4a6fd2eb397985331d209be32073259ed7c25aef4fafcabb00e483ee548e592322277eb15459bdb257b65f31146eda92684b3e7a98ea1b2dfad9b0d08ab62e10'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ TestApp::Application.config.session_store :cookie_store, :key => '_test_app_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # TestApp::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters :format => [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,4 @@
1
+ TestApp::Application.routes.draw do
2
+ resources :articles, :posts, :widgets, :dummy
3
+ get 'profiles/[:id]' => 'profiles#show'
4
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run TestApp::Application
@@ -0,0 +1,13 @@
1
+ class CreateArticles < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :articles do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :articles
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :posts do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :posts
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ class CreateWidgets < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :widgets do |t|
4
+ t.string :name
5
+ t.integer :impressions_count, :default => 0
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :widgets
13
+ end
14
+ end
15
+
@@ -0,0 +1,32 @@
1
+ class CreateImpressionsTable < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :impressions, :force => true do |t|
4
+ t.string :impressionable_type
5
+ t.integer :impressionable_id
6
+ t.integer :user_id
7
+ t.string :controller_name
8
+ t.string :action_name
9
+ t.string :view_name
10
+ t.string :request_hash
11
+ t.string :ip_address
12
+ t.string :session_hash
13
+ t.text :message
14
+ t.text :params
15
+ t.text :referrer
16
+ t.timestamps
17
+ end
18
+ add_index :impressions, [:impressionable_type, :message, :impressionable_id], :name => "impressionable_type_message_index", :unique => false, :length => {:message => 255 }
19
+ add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash], :name => "poly_request_index", :unique => false
20
+ add_index :impressions, [:impressionable_type, :impressionable_id, :ip_address], :name => "poly_ip_index", :unique => false
21
+ add_index :impressions, [:impressionable_type, :impressionable_id, :session_hash], :name => "poly_session_index", :unique => false
22
+ add_index :impressions, [:controller_name,:action_name,:request_hash], :name => "controlleraction_request_index", :unique => false
23
+ add_index :impressions, [:controller_name,:action_name,:ip_address], :name => "controlleraction_ip_index", :unique => false
24
+ add_index :impressions, [:controller_name,:action_name,:session_hash], :name => "controlleraction_session_index", :unique => false
25
+ add_index :impressions, [:impressionable_type, :impressionable_id, :params], :name => "poly_params_request_index", :unique => false
26
+ add_index :impressions, :user_id
27
+ end
28
+
29
+ def self.down
30
+ drop_table :impressions
31
+ end
32
+ end
@@ -0,0 +1,10 @@
1
+ class CreateProfiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :profiles do |t|
4
+ t.string :username
5
+ t.string :slug
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ class CreateFriendlyIdSlugs < ActiveRecord::Migration
2
+
3
+ def self.up
4
+ create_table :friendly_id_slugs do |t|
5
+ t.string :slug, :null => false
6
+ t.integer :sluggable_id, :null => false
7
+ t.string :sluggable_type, :limit => 40
8
+ t.datetime :created_at
9
+ end
10
+ add_index :friendly_id_slugs, :sluggable_id
11
+ add_index :friendly_id_slugs, [:slug, :sluggable_type], :unique => true
12
+ add_index :friendly_id_slugs, :sluggable_type
13
+ end
14
+
15
+ def self.down
16
+ drop_table :friendly_id_slugs
17
+ end
18
+ end
@@ -0,0 +1,80 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20150207140310) do
15
+
16
+ create_table "articles", :force => true do |t|
17
+ t.string "name"
18
+ t.datetime "created_at", :null => false
19
+ t.datetime "updated_at", :null => false
20
+ end
21
+
22
+ create_table "friendly_id_slugs", :force => true do |t|
23
+ t.string "slug", :null => false
24
+ t.integer "sluggable_id", :null => false
25
+ t.string "sluggable_type", :limit => 40
26
+ t.datetime "created_at"
27
+ end
28
+
29
+ add_index "friendly_id_slugs", ["slug", "sluggable_type"], :name => "index_friendly_id_slugs_on_slug_and_sluggable_type", :unique => true
30
+ add_index "friendly_id_slugs", ["sluggable_id"], :name => "index_friendly_id_slugs_on_sluggable_id"
31
+ add_index "friendly_id_slugs", ["sluggable_type"], :name => "index_friendly_id_slugs_on_sluggable_type"
32
+
33
+ create_table "impressions", :force => true do |t|
34
+ t.string "impressionable_type"
35
+ t.integer "impressionable_id"
36
+ t.integer "user_id"
37
+ t.string "controller_name"
38
+ t.string "action_name"
39
+ t.string "view_name"
40
+ t.string "request_hash"
41
+ t.string "ip_address"
42
+ t.string "session_hash"
43
+ t.text "message"
44
+ t.text "params"
45
+ t.text "referrer"
46
+ t.datetime "created_at", :null => false
47
+ t.datetime "updated_at", :null => false
48
+ end
49
+
50
+ add_index "impressions", ["controller_name", "action_name", "ip_address"], :name => "controlleraction_ip_index"
51
+ add_index "impressions", ["controller_name", "action_name", "request_hash"], :name => "controlleraction_request_index"
52
+ add_index "impressions", ["controller_name", "action_name", "session_hash"], :name => "controlleraction_session_index"
53
+ add_index "impressions", ["impressionable_type", "impressionable_id", "ip_address"], :name => "poly_ip_index"
54
+ add_index "impressions", ["impressionable_type", "impressionable_id", "params"], :name => "poly_params_request_index"
55
+ add_index "impressions", ["impressionable_type", "impressionable_id", "request_hash"], :name => "poly_request_index"
56
+ add_index "impressions", ["impressionable_type", "impressionable_id", "session_hash"], :name => "poly_session_index"
57
+ add_index "impressions", ["impressionable_type", "message", "impressionable_id"], :name => "impressionable_type_message_index"
58
+ add_index "impressions", ["user_id"], :name => "index_impressions_on_user_id"
59
+
60
+ create_table "posts", :force => true do |t|
61
+ t.string "name"
62
+ t.datetime "created_at", :null => false
63
+ t.datetime "updated_at", :null => false
64
+ end
65
+
66
+ create_table "profiles", :force => true do |t|
67
+ t.string "username"
68
+ t.string "slug"
69
+ t.datetime "created_at", :null => false
70
+ t.datetime "updated_at", :null => false
71
+ end
72
+
73
+ create_table "widgets", :force => true do |t|
74
+ t.string "name"
75
+ t.integer "impressions_count", :default => 0
76
+ t.datetime "created_at", :null => false
77
+ t.datetime "updated_at", :null => false
78
+ end
79
+
80
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Emanuel', :city => cities.first)
File without changes
File without changes
@@ -0,0 +1,53 @@
1
+ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
+ # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
+ # files.
6
+
7
+
8
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9
+
10
+ vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11
+ $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12
+
13
+ begin
14
+ require 'cucumber/rake/task'
15
+
16
+ namespace :cucumber do
17
+ Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
18
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19
+ t.fork = true # You may get faster startup if you set this to false
20
+ t.profile = 'default'
21
+ end
22
+
23
+ Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
24
+ t.binary = vendored_cucumber_bin
25
+ t.fork = true # You may get faster startup if you set this to false
26
+ t.profile = 'wip'
27
+ end
28
+
29
+ Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
30
+ t.binary = vendored_cucumber_bin
31
+ t.fork = true # You may get faster startup if you set this to false
32
+ t.profile = 'rerun'
33
+ end
34
+
35
+ desc 'Run all features'
36
+ task :all => [:ok, :wip]
37
+ end
38
+ desc 'Alias for cucumber:ok'
39
+ task :cucumber => 'cucumber:ok'
40
+
41
+ task :default => :cucumber
42
+
43
+ task :features => :cucumber do
44
+ STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
45
+ end
46
+ rescue LoadError
47
+ desc 'cucumber rake task not available (cucumber not installed)'
48
+ task :cucumber do
49
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
50
+ end
51
+ end
52
+
53
+ end
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes