mousereco 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE.txt +22 -0
- data/README.md +34 -0
- data/Rakefile +34 -0
- data/app/assets/javascripts/mousereco/mousereco.js +15 -0
- data/app/assets/javascripts/mousereco/pageviews.js +244 -0
- data/app/assets/javascripts/mousereco/tracker.js.erb +312 -0
- data/app/assets/stylesheets/mousereco/bootstrap.min.css +9 -0
- data/app/assets/stylesheets/mousereco/mousereco.css +39 -0
- data/app/controllers/mousereco/api/v1/application_controller.rb +18 -0
- data/app/controllers/mousereco/api/v1/events_controller.rb +17 -0
- data/app/controllers/mousereco/api/v1/pageviews_controller.rb +21 -0
- data/app/controllers/mousereco/application_controller.rb +5 -0
- data/app/controllers/mousereco/pageviews_controller.rb +8 -0
- data/app/controllers/mousereco/trackers_controller.rb +6 -0
- data/app/controllers/mousereco/visitors_controller.rb +5 -0
- data/app/helpers/mousereco/application_helper.rb +4 -0
- data/app/helpers/mousereco/pageview_helper.rb +7 -0
- data/app/models/mousereco/click.rb +4 -0
- data/app/models/mousereco/event.rb +13 -0
- data/app/models/mousereco/mousemove.rb +4 -0
- data/app/models/mousereco/pageview.rb +15 -0
- data/app/models/mousereco/scroll.rb +4 -0
- data/app/models/mousereco/visitor.rb +13 -0
- data/app/services/mousereco/events_service.rb +21 -0
- data/app/services/mousereco/pageviews_service.rb +14 -0
- data/app/views/layouts/mousereco/application.html.haml +21 -0
- data/app/views/mousereco/pageviews/page_html.html.haml +1 -0
- data/app/views/mousereco/pageviews/show.html.haml +18 -0
- data/app/views/mousereco/visitors/index.html.haml +12 -0
- data/config/routes.rb +25 -0
- data/db/migrate/20140128001612_create_mousereco_events.rb +14 -0
- data/db/migrate/20140128001832_create_mousereco_pageviews.rb +17 -0
- data/db/migrate/20140128001950_create_mousereco_visitors.rb +9 -0
- data/db/migrate/20140130215132_add_limit_to_timestamps.rb +12 -0
- data/lib/generators/mousereco/install/install_generator.rb +22 -0
- data/lib/mousereco/engine.rb +9 -0
- data/lib/mousereco/version.rb +3 -0
- data/lib/mousereco.rb +4 -0
- data/lib/tasks/mousereco_tasks.rake +4 -0
- data/spec/api/mousereco/events_api_spec.rb +37 -0
- data/spec/api/mousereco/pageviews_api_spec.rb +58 -0
- data/spec/controllers/mousereco/pageviews_controller_spec.rb +12 -0
- data/spec/controllers/mousereco/visitors_controller_spec.rb +12 -0
- data/spec/dummy/Gemfile +31 -0
- data/spec/dummy/Gemfile.lock +174 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +14 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/home_controller.rb +4 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/home/index.html.haml +2 -0
- data/spec/dummy/app/views/layouts/application.html.haml +17 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config/application.rb +27 -0
- data/spec/dummy/config/boot.rb +4 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +29 -0
- data/spec/dummy/config/environments/production.rb +80 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +12 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +7 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20140128221416_create_mousereco_events.mousereco.rb +15 -0
- data/spec/dummy/db/migrate/20140128221417_create_mousereco_pageviews.mousereco.rb +18 -0
- data/spec/dummy/db/migrate/20140128221418_create_mousereco_visitors.mousereco.rb +10 -0
- data/spec/dummy/db/migrate/20140130215835_add_limit_to_timestamps.mousereco.rb +13 -0
- data/spec/dummy/db/schema.rb +48 -0
- data/spec/dummy/db/seeds.rb +7 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +13721 -0
- data/spec/dummy/log/test.log +13232 -0
- data/spec/dummy/public/404.html +58 -0
- data/spec/dummy/public/422.html +58 -0
- data/spec/dummy/public/500.html +57 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/public/test.html +59 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1510a9c9dc22b2be9eed26a8ed2dabe8 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/16d2919a6d361fd8c6e82b279d64067d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1d3e49d5614179160c0b571a9927dcc1 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/1de21ea3d9fadc1a1c3269614b19495b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2533caf6d0459a8624fd40d33cddde85 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/29cde272ab8d39abcb99bfc3cba51e1b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2fd3dabf7baee6c0702bc29f86d2a70c +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2ffb0b37de65c4bc12c9759935bcfa4a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/40091f436d9a77d1d9a9de7f3da46098 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/48139bef1023ab80e22b4891191c5c3a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/4ea33e825e6e38bd22dccab488a0255b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/54d5f50daadb633077b6cd9dd9fb72cc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5817965bb0355e7b0da40f9b36153ef6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5cbf24a4616e0252f26d7949679a42fe +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/5d1aff6b78ca0eab106290139d3410a3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/6d498a2bfb1bc8566133e4eb5c0ccd35 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/727930fb0f32b87625179e6a77770d16 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7be9086c960bb4384c9d23a52e489f29 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7cd76d5e9ba9b8658678d1455acfab74 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/7d94acf804831ce74c7bf5455c1782f0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/8f8936f164170e095c5ca2d0c2ae6127 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/912559948251ede2d7fcd0cbd58654da +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/9d48f1ca00d652a327f6e8f7c7fc0d40 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/a9cf04e553d11e0103cf1c870e363d7d +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b02bb55c99ea1e7b80cf52548ee0d1c5 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/b9b341a8be874e4eee26dce66499bc80 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/c6793056549a28ef6b4d0a4a8929f7e3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cac5a12e0a520ce86636e0443f3da875 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cb21171d87e8bb8b243a86594263deff +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cc5195a4891bb336aeb52b296f4971e9 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d44cfedd9e50cf9fd20463a31bad4ce3 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e6c6c2db7ca06e62d0b8d81c9ee3fcf0 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e73e1a39e822bb2763fbb90a3d41498f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/eae4c7b940819b55676cea6e03251739 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f6f1db9d7bdcc747aae3fe9f3ec43dab +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/fe8b16f9af7353e9609c7fe6259d6912 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/1d3e49d5614179160c0b571a9927dcc1 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2154a1002f636a71bd688ee3b7a40295 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/2ffb0b37de65c4bc12c9759935bcfa4a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/40091f436d9a77d1d9a9de7f3da46098 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/417edfca088d0fa2811b10666b3adea4 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/48139bef1023ab80e22b4891191c5c3a +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/4ea33e825e6e38bd22dccab488a0255b +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/54d5f50daadb633077b6cd9dd9fb72cc +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5817965bb0355e7b0da40f9b36153ef6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/5cbf24a4616e0252f26d7949679a42fe +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/6d498a2bfb1bc8566133e4eb5c0ccd35 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7be9086c960bb4384c9d23a52e489f29 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/7d94acf804831ce74c7bf5455c1782f0 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/9fe452757d2a02edb37d0d7901709d9c +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/a9cf04e553d11e0103cf1c870e363d7d +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b02bb55c99ea1e7b80cf52548ee0d1c5 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/b9b341a8be874e4eee26dce66499bc80 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/c7cac2711d4e453b8698081414f6bc73 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cac5a12e0a520ce86636e0443f3da875 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cb21171d87e8bb8b243a86594263deff +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cc5195a4891bb336aeb52b296f4971e9 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/e6c6c2db7ca06e62d0b8d81c9ee3fcf0 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f6f1db9d7bdcc747aae3fe9f3ec43dab +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/test/sprockets/fe8b16f9af7353e9609c7fe6259d6912 +0 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/spec/fabricators/pageview.rb +3 -0
- data/spec/fabricators/visitor.rb +3 -0
- data/spec/spec_helper.rb +20 -0
- metadata +393 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
MouseRecorder::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
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both thread web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
+
config.serve_static_assets = false
|
24
|
+
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
28
|
+
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
30
|
+
config.assets.compile = false
|
31
|
+
|
32
|
+
# Generate digests for assets URLs.
|
33
|
+
config.assets.digest = true
|
34
|
+
|
35
|
+
# Version of your assets, change this if you want to expire all your assets.
|
36
|
+
config.assets.version = '1.0'
|
37
|
+
|
38
|
+
# Specifies the header that your server uses for sending files.
|
39
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
40
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
41
|
+
|
42
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
|
+
# config.force_ssl = true
|
44
|
+
|
45
|
+
# Set to :debug to see everything in the log.
|
46
|
+
config.log_level = :info
|
47
|
+
|
48
|
+
# Prepend all log lines with the following tags.
|
49
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
50
|
+
|
51
|
+
# Use a different logger for distributed setups.
|
52
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
53
|
+
|
54
|
+
# Use a different cache store in production.
|
55
|
+
# config.cache_store = :mem_cache_store
|
56
|
+
|
57
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
58
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
59
|
+
|
60
|
+
# Precompile additional assets.
|
61
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
62
|
+
# config.assets.precompile += %w( search.js )
|
63
|
+
|
64
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
65
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
66
|
+
# config.action_mailer.raise_delivery_errors = false
|
67
|
+
|
68
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
69
|
+
# the I18n.default_locale when a translation can not be found).
|
70
|
+
config.i18n.fallbacks = true
|
71
|
+
|
72
|
+
# Send deprecation notices to registered listeners.
|
73
|
+
config.active_support.deprecation = :notify
|
74
|
+
|
75
|
+
# Disable automatic flushing of the log to improve performance.
|
76
|
+
# config.autoflush_log = false
|
77
|
+
|
78
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
+
config.log_formatter = ::Logger::Formatter.new
|
80
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
MouseRecorder::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
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
14
|
+
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_assets = true
|
17
|
+
config.static_cache_control = "public, max-age=3600"
|
18
|
+
|
19
|
+
# Show full error reports and disable caching.
|
20
|
+
config.consider_all_requests_local = true
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
24
|
+
config.action_dispatch.show_exceptions = false
|
25
|
+
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
|
+
|
29
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
+
# The :test delivery method accumulates sent emails in the
|
31
|
+
# ActionMailer::Base.deliveries array.
|
32
|
+
config.action_mailer.delivery_method = :test
|
33
|
+
|
34
|
+
# Print deprecation notices to the stderr.
|
35
|
+
config.active_support.deprecation = :stderr
|
36
|
+
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,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
MouseRecorder::Application.config.secret_key_base = '838c3316edd16833d9b293ee25b0c4fa7bbbc6d41a0b6dbe6afc47a2c6b737db279ff3d81ac7da6114bb99cd3033d8adfccb9a30cde37a514b028febb2421883'
|
@@ -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] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from mousereco (originally 20140128001612)
|
2
|
+
class CreateMouserecoEvents < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :mousereco_events do |t|
|
5
|
+
t.float :x
|
6
|
+
t.float :y
|
7
|
+
t.integer :timestamp
|
8
|
+
t.integer :pageview_id
|
9
|
+
t.string :type
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
add_index :mousereco_events, :pageview_id
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This migration comes from mousereco (originally 20140128001832)
|
2
|
+
class CreateMouserecoPageviews < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :mousereco_pageviews do |t|
|
5
|
+
t.string :url
|
6
|
+
t.string :key
|
7
|
+
t.integer :visitor_id
|
8
|
+
t.text :page_html
|
9
|
+
t.integer :window_width
|
10
|
+
t.integer :window_height
|
11
|
+
t.integer :timestamp
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
|
16
|
+
add_index :mousereco_pageviews, :visitor_id
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from mousereco (originally 20140130215132)
|
2
|
+
class AddLimitToTimestamps < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
#these probably should be stored as timestamp type, not integers. not refactoring yet
|
5
|
+
change_column :mousereco_events, :timestamp, :integer, limit: 5
|
6
|
+
change_column :mousereco_pageviews, :timestamp, :integer, limit: 5
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
change_column :mousereco_events, :timestamp, :integer
|
11
|
+
change_column :mousereco_pageviews, :timestamp, :integer
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,48 @@
|
|
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 that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 20140130215835) do
|
15
|
+
|
16
|
+
create_table "mousereco_events", force: true do |t|
|
17
|
+
t.float "x"
|
18
|
+
t.float "y"
|
19
|
+
t.integer "timestamp", limit: 5
|
20
|
+
t.integer "pageview_id"
|
21
|
+
t.string "type"
|
22
|
+
t.datetime "created_at"
|
23
|
+
t.datetime "updated_at"
|
24
|
+
end
|
25
|
+
|
26
|
+
add_index "mousereco_events", ["pageview_id"], name: "index_mousereco_events_on_pageview_id"
|
27
|
+
|
28
|
+
create_table "mousereco_pageviews", force: true do |t|
|
29
|
+
t.string "url"
|
30
|
+
t.string "key"
|
31
|
+
t.integer "visitor_id"
|
32
|
+
t.text "page_html"
|
33
|
+
t.integer "window_width"
|
34
|
+
t.integer "window_height"
|
35
|
+
t.integer "timestamp", limit: 5
|
36
|
+
t.datetime "created_at"
|
37
|
+
t.datetime "updated_at"
|
38
|
+
end
|
39
|
+
|
40
|
+
add_index "mousereco_pageviews", ["visitor_id"], name: "index_mousereco_pageviews_on_visitor_id"
|
41
|
+
|
42
|
+
create_table "mousereco_visitors", force: true do |t|
|
43
|
+
t.string "key"
|
44
|
+
t.datetime "created_at"
|
45
|
+
t.datetime "updated_at"
|
46
|
+
end
|
47
|
+
|
48
|
+
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)
|
Binary file
|