enju_export 0.0.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 (80) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +47 -0
  4. data/app/controllers/export_files_controller.rb +106 -0
  5. data/app/models/export_file.rb +19 -0
  6. data/app/views/export_files/_download.html.erb +1 -0
  7. data/app/views/export_files/_form.html.erb +14 -0
  8. data/app/views/export_files/edit.html.erb +6 -0
  9. data/app/views/export_files/index.html.erb +32 -0
  10. data/app/views/export_files/new.html.erb +5 -0
  11. data/app/views/export_files/show.html.erb +25 -0
  12. data/app/views/export_files/show.js.erb +1 -0
  13. data/app/views/page/403.html.erb +9 -0
  14. data/app/views/page/403.mobile.erb +5 -0
  15. data/app/views/page/403.xml.erb +4 -0
  16. data/app/views/page/404.html.erb +9 -0
  17. data/app/views/page/404.mobile.erb +5 -0
  18. data/app/views/page/404.xml.erb +4 -0
  19. data/config/locales/translation_en.yml +9 -0
  20. data/config/locales/translation_ja.yml +8 -0
  21. data/config/routes.rb +3 -0
  22. data/db/migrate/20120610075759_create_export_files.rb +12 -0
  23. data/lib/enju_export/engine.rb +9 -0
  24. data/lib/enju_export/version.rb +3 -0
  25. data/lib/enju_export.rb +36 -0
  26. data/lib/tasks/enju_export_tasks.rake +4 -0
  27. data/spec/controllers/export_files_controller_spec.rb +75 -0
  28. data/spec/dummy/README.rdoc +261 -0
  29. data/spec/dummy/Rakefile +7 -0
  30. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  31. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  32. data/spec/dummy/app/controllers/application_controller.rb +23 -0
  33. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  34. data/spec/dummy/app/models/ability.rb +14 -0
  35. data/spec/dummy/app/models/role.rb +47 -0
  36. data/spec/dummy/app/models/user.rb +28 -0
  37. data/spec/dummy/app/models/user_has_role.rb +4 -0
  38. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  39. data/spec/dummy/config/application.rb +60 -0
  40. data/spec/dummy/config/boot.rb +10 -0
  41. data/spec/dummy/config/database.yml +25 -0
  42. data/spec/dummy/config/environment.rb +5 -0
  43. data/spec/dummy/config/environments/development.rb +37 -0
  44. data/spec/dummy/config/environments/production.rb +67 -0
  45. data/spec/dummy/config/environments/test.rb +37 -0
  46. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/spec/dummy/config/initializers/devise.rb +205 -0
  48. data/spec/dummy/config/initializers/inflections.rb +15 -0
  49. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  50. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  51. data/spec/dummy/config/initializers/session_store.rb +8 -0
  52. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  53. data/spec/dummy/config/locales/en.yml +5 -0
  54. data/spec/dummy/config/routes.rb +60 -0
  55. data/spec/dummy/config.ru +4 -0
  56. data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
  57. data/spec/dummy/db/migrate/20111201155456_create_users.rb +13 -0
  58. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +52 -0
  59. data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
  60. data/spec/dummy/db/schema.rb +73 -0
  61. data/spec/dummy/db/test.sqlite3 +0 -0
  62. data/spec/dummy/public/404.html +26 -0
  63. data/spec/dummy/public/422.html +26 -0
  64. data/spec/dummy/public/500.html +25 -0
  65. data/spec/dummy/public/favicon.ico +0 -0
  66. data/spec/dummy/script/rails +6 -0
  67. data/spec/fixtures/roles.yml +21 -0
  68. data/spec/fixtures/user_has_roles.yml +41 -0
  69. data/spec/fixtures/users.yml +69 -0
  70. data/spec/models/export_file_spec.rb +5 -0
  71. data/spec/requests/export_files_spec.rb +11 -0
  72. data/spec/routing/export_files_routing_spec.rb +19 -0
  73. data/spec/spec_helper.rb +34 -0
  74. data/spec/support/controller_macros.rb +25 -0
  75. data/spec/support/devise.rb +4 -0
  76. data/spec/views/export_files/edit.html.erb_spec.rb +24 -0
  77. data/spec/views/export_files/index.html.erb_spec.rb +29 -0
  78. data/spec/views/export_files/new.html.erb_spec.rb +24 -0
  79. data/spec/views/export_files/show.html.erb_spec.rb +18 -0
  80. metadata +273 -0
@@ -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
@@ -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,205 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth.
2
+ # Many of these configuration options can be set straight in your model.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in Devise::Mailer,
6
+ # note that it will be overwritten if you use your own mailer class with default "from" parameter.
7
+ config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
8
+
9
+ # Configure the class responsible to send e-mails.
10
+ # config.mailer = "Devise::Mailer"
11
+
12
+ # ==> ORM configuration
13
+ # Load and configure the ORM. Supports :active_record (default) and
14
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
15
+ # available as additional gems.
16
+ require 'devise/orm/active_record'
17
+
18
+ # ==> Configuration for any authentication mechanism
19
+ # Configure which keys are used when authenticating a user. The default is
20
+ # just :email. You can configure it to use [:username, :subdomain], so for
21
+ # authenticating a user, both parameters are required. Remember that those
22
+ # parameters are used only when authenticating and not when retrieving from
23
+ # session. If you need permissions, you should implement that in a before filter.
24
+ # You can also supply a hash where the value is a boolean determining whether
25
+ # or not authentication should be aborted when the value is not present.
26
+ # config.authentication_keys = [ :email ]
27
+
28
+ # Configure parameters from the request object used for authentication. Each entry
29
+ # given should be a request method and it will automatically be passed to the
30
+ # find_for_authentication method and considered in your model lookup. For instance,
31
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
32
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
33
+ # config.request_keys = []
34
+
35
+ # Configure which authentication keys should be case-insensitive.
36
+ # These keys will be downcased upon creating or modifying a user and when used
37
+ # to authenticate or find a user. Default is :email.
38
+ config.case_insensitive_keys = [ :email ]
39
+
40
+ # Configure which authentication keys should have whitespace stripped.
41
+ # These keys will have whitespace before and after removed upon creating or
42
+ # modifying a user and when used to authenticate or find a user. Default is :email.
43
+ config.strip_whitespace_keys = [ :email ]
44
+
45
+ # Tell if authentication through request.params is enabled. True by default.
46
+ # config.params_authenticatable = true
47
+
48
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
49
+ # config.http_authenticatable = false
50
+
51
+ # If http headers should be returned for AJAX requests. True by default.
52
+ # config.http_authenticatable_on_xhr = true
53
+
54
+ # The realm used in Http Basic Authentication. "Application" by default.
55
+ # config.http_authentication_realm = "Application"
56
+
57
+ # It will change confirmation, password recovery and other workflows
58
+ # to behave the same regardless if the e-mail provided was right or wrong.
59
+ # Does not affect registerable.
60
+ # config.paranoid = true
61
+
62
+ # ==> Configuration for :database_authenticatable
63
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
64
+ # using other encryptors, it sets how many times you want the password re-encrypted.
65
+ #
66
+ # Limiting the stretches to just one in testing will increase the performance of
67
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
68
+ # a value less than 10 in other environments.
69
+ config.stretches = Rails.env.test? ? 1 : 10
70
+
71
+ # Setup a pepper to generate the encrypted password.
72
+ # config.pepper = "9c3e60feae3030ec50d52f408005d7083c980b028e24e96536c60829394fd7cf5e26fdfed03e48b756b8bbf16177d73cca8cc6d036b2e916c953faf8d2c0238c"
73
+
74
+ # ==> Configuration for :confirmable
75
+ # A period that the user is allowed to access the website even without
76
+ # confirming his account. For instance, if set to 2.days, the user will be
77
+ # able to access the website for two days without confirming his account,
78
+ # access will be blocked just in the third day. Default is 0.days, meaning
79
+ # the user cannot access the website without confirming his account.
80
+ # config.confirm_within = 2.days
81
+
82
+ # Defines which key will be used when confirming an account
83
+ # config.confirmation_keys = [ :email ]
84
+
85
+ # ==> Configuration for :rememberable
86
+ # The time the user will be remembered without asking for credentials again.
87
+ # config.remember_for = 2.weeks
88
+
89
+ # If true, a valid remember token can be re-used between multiple browsers.
90
+ # config.remember_across_browsers = true
91
+
92
+ # If true, extends the user's remember period when remembered via cookie.
93
+ # config.extend_remember_period = false
94
+
95
+ # Options to be passed to the created cookie. For instance, you can set
96
+ # :secure => true in order to force SSL only cookies.
97
+ # config.cookie_options = {}
98
+
99
+ # ==> Configuration for :validatable
100
+ # Range for password length. Default is 6..128.
101
+ # config.password_length = 6..128
102
+
103
+ # Email regex used to validate email formats. It simply asserts that
104
+ # an one (and only one) @ exists in the given string. This is mainly
105
+ # to give user feedback and not to assert the e-mail validity.
106
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
107
+
108
+ # ==> Configuration for :timeoutable
109
+ # The time you want to timeout the user session without activity. After this
110
+ # time the user will be asked for credentials again. Default is 30 minutes.
111
+ # config.timeout_in = 30.minutes
112
+
113
+ # ==> Configuration for :lockable
114
+ # Defines which strategy will be used to lock an account.
115
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
116
+ # :none = No lock strategy. You should handle locking by yourself.
117
+ # config.lock_strategy = :failed_attempts
118
+
119
+ # Defines which key will be used when locking and unlocking an account
120
+ # config.unlock_keys = [ :email ]
121
+
122
+ # Defines which strategy will be used to unlock an account.
123
+ # :email = Sends an unlock link to the user email
124
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
125
+ # :both = Enables both strategies
126
+ # :none = No unlock strategy. You should handle unlocking by yourself.
127
+ # config.unlock_strategy = :both
128
+
129
+ # Number of authentication tries before locking an account if lock_strategy
130
+ # is failed attempts.
131
+ # config.maximum_attempts = 20
132
+
133
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
134
+ # config.unlock_in = 1.hour
135
+
136
+ # ==> Configuration for :recoverable
137
+ #
138
+ # Defines which key will be used when recovering the password for an account
139
+ # config.reset_password_keys = [ :email ]
140
+
141
+ # Time interval you can reset your password with a reset password key.
142
+ # Don't put a too small interval or your users won't have the time to
143
+ # change their passwords.
144
+ config.reset_password_within = 2.hours
145
+
146
+ # ==> Configuration for :encryptable
147
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
148
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
149
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
150
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
151
+ # REST_AUTH_SITE_KEY to pepper)
152
+ # config.encryptor = :sha512
153
+
154
+ # ==> Configuration for :token_authenticatable
155
+ # Defines name of the authentication token params key
156
+ # config.token_authentication_key = :auth_token
157
+
158
+ # If true, authentication through token does not store user in session and needs
159
+ # to be supplied on each request. Useful if you are using the token as API token.
160
+ # config.stateless_token = false
161
+
162
+ # ==> Scopes configuration
163
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
164
+ # "users/sessions/new". It's turned off by default because it's slower if you
165
+ # are using only default views.
166
+ # config.scoped_views = false
167
+
168
+ # Configure the default scope given to Warden. By default it's the first
169
+ # devise role declared in your routes (usually :user).
170
+ # config.default_scope = :user
171
+
172
+ # Configure sign_out behavior.
173
+ # Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).
174
+ # The default is true, which means any logout action will sign out all active scopes.
175
+ # config.sign_out_all_scopes = true
176
+
177
+ # ==> Navigation configuration
178
+ # Lists the formats that should be treated as navigational. Formats like
179
+ # :html, should redirect to the sign in page when the user does not have
180
+ # access, but formats like :xml or :json, should return 401.
181
+ #
182
+ # If you have any extra navigational formats, like :iphone or :mobile, you
183
+ # should add them to the navigational formats lists.
184
+ #
185
+ # The :"*/*" and "*/*" formats below is required to match Internet
186
+ # Explorer requests.
187
+ # config.navigational_formats = [:"*/*", "*/*", :html]
188
+
189
+ # The default HTTP method used to sign out a resource. Default is :delete.
190
+ config.sign_out_via = :delete
191
+
192
+ # ==> OmniAuth
193
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
194
+ # up on your models and hooks.
195
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
196
+
197
+ # ==> Warden configuration
198
+ # If you want to use other strategies, that are not supported by Devise, or
199
+ # change the failure app, you can configure them inside the config.warden block.
200
+ #
201
+ # config.warden do |manager|
202
+ # manager.intercept_401 = false
203
+ # manager.default_strategies(:scope => :user).unshift :some_external_strategy
204
+ # end
205
+ end
@@ -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
+ Dummy::Application.config.secret_token = '9e1f9157df31d2f6197987e49e7f43252bc0539d8ce872dcc1073153e7b08b8726bfe8f24f66c0dc2cbf80e15d8d607b35e6acf434fa15118fdfa6682cb84b2c'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_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
+ # Dummy::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,60 @@
1
+ Dummy::Application.routes.draw do
2
+ devise_for :users
3
+
4
+ # The priority is based upon order of creation:
5
+ # first created -> highest priority.
6
+
7
+ # Sample of regular route:
8
+ # match 'products/:id' => 'catalog#view'
9
+ # Keep in mind you can assign values other than :controller and :action
10
+
11
+ # Sample of named route:
12
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
13
+ # This route can be invoked with purchase_url(:id => product.id)
14
+
15
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
16
+ # resources :products
17
+
18
+ # Sample resource route with options:
19
+ # resources :products do
20
+ # member do
21
+ # get 'short'
22
+ # post 'toggle'
23
+ # end
24
+ #
25
+ # collection do
26
+ # get 'sold'
27
+ # end
28
+ # end
29
+
30
+ # Sample resource route with sub-resources:
31
+ # resources :products do
32
+ # resources :comments, :sales
33
+ # resource :seller
34
+ # end
35
+
36
+ # Sample resource route with more complex sub-resources
37
+ # resources :products do
38
+ # resources :comments
39
+ # resources :sales do
40
+ # get 'recent', :on => :collection
41
+ # end
42
+ # end
43
+
44
+ # Sample resource route within a namespace:
45
+ # namespace :admin do
46
+ # # Directs /admin/products/* to Admin::ProductsController
47
+ # # (app/controllers/admin/products_controller.rb)
48
+ # resources :products
49
+ # end
50
+
51
+ # You can have the root of your site routed with "root"
52
+ # just remember to delete public/index.html.
53
+ # root :to => 'welcome#index'
54
+
55
+ # See how all your routes lay out with "rake routes"
56
+
57
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
58
+ # Note: This route will make all actions in every controller accessible via GET requests.
59
+ # match ':controller(/:action(/:id))(.:format)'
60
+ 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 Dummy::Application
@@ -0,0 +1,12 @@
1
+ class CreateRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :roles do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.integer :user_group_id
5
+ t.integer :required_role_id
6
+ t.string :username
7
+ t.text :note
8
+ t.string :locale
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,52 @@
1
+ class AddDeviseToUsers < ActiveRecord::Migration
2
+ def self.up
3
+ change_table(:users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Encryptable
23
+ t.string :password_salt
24
+
25
+ ## Confirmable
26
+ t.string :confirmation_token
27
+ t.datetime :confirmed_at
28
+ t.datetime :confirmation_sent_at
29
+ t.string :unconfirmed_email # Only if using reconfirmable
30
+
31
+ ## Lockable
32
+ t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
33
+ t.string :unlock_token # Only if unlock strategy is :email or :both
34
+ t.datetime :locked_at
35
+
36
+ # Token authenticatable
37
+ t.string :authentication_token
38
+ end
39
+
40
+ add_index :users, :email #, :unique => true
41
+ add_index :users, :reset_password_token, :unique => true
42
+ # add_index :users, :confirmation_token, :unique => true
43
+ # add_index :users, :unlock_token, :unique => true
44
+ # add_index :users, :authentication_token, :unique => true
45
+ end
46
+
47
+ def self.down
48
+ # By default, we don't want to make any assumption about how to roll back a migration when your
49
+ # model already existed. Please edit below which fields you would like to remove in this migration.
50
+ raise ActiveRecord::IrreversibleMigration
51
+ end
52
+ end
@@ -0,0 +1,10 @@
1
+ class CreateUserHasRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_has_roles do |t|
4
+ t.integer :user_id
5
+ t.integer :role_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,73 @@
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 => 20120610075759) do
15
+
16
+ create_table "export_files", :force => true do |t|
17
+ t.string "export_file_name"
18
+ t.string "export_content_type"
19
+ t.string "export_file_size"
20
+ t.string "state"
21
+ t.datetime "created_at", :null => false
22
+ t.datetime "updated_at", :null => false
23
+ end
24
+
25
+ create_table "roles", :force => true do |t|
26
+ t.string "name"
27
+ t.text "display_name"
28
+ t.text "note"
29
+ t.integer "position"
30
+ t.datetime "created_at", :null => false
31
+ t.datetime "updated_at", :null => false
32
+ end
33
+
34
+ create_table "user_has_roles", :force => true do |t|
35
+ t.integer "user_id"
36
+ t.integer "role_id"
37
+ t.datetime "created_at", :null => false
38
+ t.datetime "updated_at", :null => false
39
+ end
40
+
41
+ create_table "users", :force => true do |t|
42
+ t.integer "user_group_id"
43
+ t.integer "required_role_id"
44
+ t.string "username"
45
+ t.text "note"
46
+ t.string "locale"
47
+ t.datetime "created_at", :null => false
48
+ t.datetime "updated_at", :null => false
49
+ t.string "email", :default => "", :null => false
50
+ t.string "encrypted_password", :default => "", :null => false
51
+ t.string "reset_password_token"
52
+ t.datetime "reset_password_sent_at"
53
+ t.datetime "remember_created_at"
54
+ t.integer "sign_in_count", :default => 0
55
+ t.datetime "current_sign_in_at"
56
+ t.datetime "last_sign_in_at"
57
+ t.string "current_sign_in_ip"
58
+ t.string "last_sign_in_ip"
59
+ t.string "password_salt"
60
+ t.string "confirmation_token"
61
+ t.datetime "confirmed_at"
62
+ t.datetime "confirmation_sent_at"
63
+ t.string "unconfirmed_email"
64
+ t.integer "failed_attempts", :default => 0
65
+ t.string "unlock_token"
66
+ t.datetime "locked_at"
67
+ t.string "authentication_token"
68
+ end
69
+
70
+ add_index "users", ["email"], :name => "index_users_on_email"
71
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
72
+
73
+ end
Binary file
@@ -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
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,21 @@
1
+ ---
2
+ role_00001:
3
+ name: Guest
4
+ display_name: Guest
5
+ id: 1
6
+ note:
7
+ role_00002:
8
+ name: User
9
+ display_name: User
10
+ id: 2
11
+ note:
12
+ role_00003:
13
+ name: Librarian
14
+ display_name: Librarian
15
+ id: 3
16
+ note:
17
+ role_00004:
18
+ name: Administrator
19
+ display_name: Administrator
20
+ id: 4
21
+ note: