lady_josephine 0.0.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/lady_josephine/editor_controller.rb +10 -4
  3. data/app/controllers/lady_josephine/images_controller.rb +6 -3
  4. data/app/helpers/lady_josephine/sir_trevor_helper.rb +60 -91
  5. data/app/models/lady_josephine/concerns/model.rb +3 -1
  6. data/app/models/lady_josephine/concerns/sir_trevor_images.rb +5 -7
  7. data/app/models/lady_josephine/image.rb +3 -2
  8. data/config/routes.rb +4 -4
  9. data/lib/lady_josephine/redcarpet/custom_markdown_formatter.rb +3 -0
  10. data/lib/lady_josephine/sir_trevor_view.rb +14 -0
  11. data/lib/lady_josephine/version.rb +1 -1
  12. data/lib/lady_josephine.rb +5 -0
  13. data/spec/controllers/lady_josephine/editor_controller_spec.rb +81 -57
  14. data/spec/controllers/lady_josephine/images_controller_spec.rb +35 -0
  15. data/spec/dummy/app/assets/images/depressed-cat.jpg +0 -0
  16. data/spec/dummy/app/models/article.rb +3 -0
  17. data/spec/dummy/app/models/user.rb +11 -0
  18. data/spec/dummy/config/environments/test.rb +1 -0
  19. data/spec/dummy/config/initializers/devise.rb +265 -0
  20. data/spec/dummy/config/locales/devise.en.yml +60 -0
  21. data/spec/dummy/config/routes.rb +3 -1
  22. data/spec/dummy/db/development.sqlite3 +0 -0
  23. data/spec/dummy/db/migrate/20160307143232_create_articles.rb +9 -0
  24. data/spec/dummy/db/migrate/20160307143714_add_lady_josephine_to_articles.rb +9 -0
  25. data/spec/dummy/db/migrate/20160308091107_create_users.rb +10 -0
  26. data/spec/dummy/db/migrate/20160308131853_add_devise_to_users.rb +49 -0
  27. data/spec/dummy/db/schema.rb +44 -1
  28. data/spec/dummy/db/test.sqlite3 +0 -0
  29. data/spec/dummy/log/development.log +284 -0
  30. data/spec/dummy/log/test.log +19983 -0
  31. data/spec/dummy/public/storage/test/lady_josephine/image/file/1/depressed-cat.jpg +0 -0
  32. data/spec/dummy/public/storage/test/lady_josephine/image/file/1/w1000_depressed-cat.jpg +0 -0
  33. data/spec/dummy/public/storage/test/lady_josephine/image/file/1/w2000_depressed-cat.jpg +0 -0
  34. data/spec/dummy/public/storage/test/lady_josephine/image/file/1/w300_depressed-cat.jpg +0 -0
  35. data/spec/dummy/public/storage/test/lady_josephine/image/file/1/w600_depressed-cat.jpg +0 -0
  36. data/spec/dummy/public/uploads/tmp/1457361805-21265-0640/depressed-cat.jpg +0 -0
  37. data/spec/dummy/public/uploads/tmp/1457361805-21265-0640/w1000_depressed-cat.jpg +0 -0
  38. data/spec/dummy/public/uploads/tmp/1457361805-21265-0640/w300_depressed-cat.jpg +0 -0
  39. data/spec/dummy/public/uploads/tmp/1457361805-21265-5269/w2000_depressed-cat.jpg +0 -0
  40. data/spec/dummy/public/uploads/tmp/1457361805-21265-8125/w600_depressed-cat.jpg +0 -0
  41. data/spec/dummy/public/uploads/tmp/1457361816-21343-4543/w2000_depressed-cat.jpg +0 -0
  42. data/spec/dummy/public/uploads/tmp/1457361816-21343-6347/depressed-cat.jpg +0 -0
  43. data/spec/dummy/public/uploads/tmp/1457361816-21343-6347/w1000_depressed-cat.jpg +0 -0
  44. data/spec/dummy/public/uploads/tmp/1457361816-21343-6347/w300_depressed-cat.jpg +0 -0
  45. data/spec/dummy/public/uploads/tmp/1457361816-21343-7612/w600_depressed-cat.jpg +0 -0
  46. data/spec/dummy/public/uploads/tmp/1457515799-18442-6177/depressed-cat.jpg +0 -0
  47. data/spec/dummy/public/uploads/tmp/1457515799-18442-6177/w1000_depressed-cat.jpg +0 -0
  48. data/spec/dummy/public/uploads/tmp/1457515799-18442-6177/w300_depressed-cat.jpg +0 -0
  49. data/spec/dummy/public/uploads/tmp/1457515800-18442-3701/w2000_depressed-cat.jpg +0 -0
  50. data/spec/dummy/public/uploads/tmp/1457515800-18442-7909/w600_depressed-cat.jpg +0 -0
  51. data/spec/dummy/public/uploads/tmp/1457515954-18760-0051/depressed-cat.jpg +0 -0
  52. data/spec/dummy/public/uploads/tmp/1457515954-18760-0051/w1000_depressed-cat.jpg +0 -0
  53. data/spec/dummy/public/uploads/tmp/1457515954-18760-0051/w300_depressed-cat.jpg +0 -0
  54. data/spec/dummy/public/uploads/tmp/1457515955-18760-3846/w2000_depressed-cat.jpg +0 -0
  55. data/spec/dummy/public/uploads/tmp/1457515955-18760-7040/w600_depressed-cat.jpg +0 -0
  56. data/spec/helper/lady_josephine/helper_spec.rb +29 -0
  57. data/spec/helper/lady_josephine/sir_trevor_helper_spec.rb +166 -0
  58. data/spec/lib/redcarpet/custom_markdown_formatter_spec.rb +98 -0
  59. data/spec/lib/renderer/sir_trevor_renderer_spec.rb +27 -0
  60. data/spec/lib/whitelist_spec.rb +48 -0
  61. data/spec/models/lady_josephine/concerns/model_spec.rb +24 -0
  62. data/spec/models/lady_josephine/concerns/pingable_spec.rb +79 -0
  63. data/spec/models/lady_josephine/concerns/server_uuid_spec.rb +23 -0
  64. data/spec/models/lady_josephine/concerns/sir_trevor_images_spec.rb +50 -0
  65. data/spec/models/lady_josephine/image_spec.rb +68 -0
  66. data/spec/spec_helper.rb +4 -1
  67. metadata +125 -2
@@ -0,0 +1,265 @@
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
+ # The secret key used by Devise. Devise uses this key to generate
5
+ # random tokens. Changing this key will render invalid all existing
6
+ # confirmation, reset password and unlock tokens in the database.
7
+ # Devise will use the `secret_key_base` on Rails 4+ applications as its `secret_key`
8
+ # by default. You can change it below and use your own secret key.
9
+ # config.secret_key = 'ab561eb4a72a3f44e412ae667cb3c27fb00bd0fe3ef6f8f5c78111ee0e2aaf3f04c8506aadefbc2160ac256a5ad09e20d33e755ddd80135ea7fe91beb9dcf9b4'
10
+
11
+ # ==> Mailer Configuration
12
+ # Configure the e-mail address which will be shown in Devise::Mailer,
13
+ # note that it will be overwritten if you use your own mailer class
14
+ # with default "from" parameter.
15
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
16
+
17
+ # Configure the class responsible to send e-mails.
18
+ # config.mailer = 'Devise::Mailer'
19
+
20
+ # ==> ORM configuration
21
+ # Load and configure the ORM. Supports :active_record (default) and
22
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
23
+ # available as additional gems.
24
+ require 'devise/orm/active_record'
25
+
26
+ # ==> Configuration for any authentication mechanism
27
+ # Configure which keys are used when authenticating a user. The default is
28
+ # just :email. You can configure it to use [:username, :subdomain], so for
29
+ # authenticating a user, both parameters are required. Remember that those
30
+ # parameters are used only when authenticating and not when retrieving from
31
+ # session. If you need permissions, you should implement that in a before filter.
32
+ # You can also supply a hash where the value is a boolean determining whether
33
+ # or not authentication should be aborted when the value is not present.
34
+ # config.authentication_keys = [:email]
35
+
36
+ # Configure parameters from the request object used for authentication. Each entry
37
+ # given should be a request method and it will automatically be passed to the
38
+ # find_for_authentication method and considered in your model lookup. For instance,
39
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
40
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
41
+ # config.request_keys = []
42
+
43
+ # Configure which authentication keys should be case-insensitive.
44
+ # These keys will be downcased upon creating or modifying a user and when used
45
+ # to authenticate or find a user. Default is :email.
46
+ config.case_insensitive_keys = [:email]
47
+
48
+ # Configure which authentication keys should have whitespace stripped.
49
+ # These keys will have whitespace before and after removed upon creating or
50
+ # modifying a user and when used to authenticate or find a user. Default is :email.
51
+ config.strip_whitespace_keys = [:email]
52
+
53
+ # Tell if authentication through request.params is enabled. True by default.
54
+ # It can be set to an array that will enable params authentication only for the
55
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
56
+ # enable it only for database (email + password) authentication.
57
+ # config.params_authenticatable = true
58
+
59
+ # Tell if authentication through HTTP Auth is enabled. False by default.
60
+ # It can be set to an array that will enable http authentication only for the
61
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
62
+ # enable it only for database authentication. The supported strategies are:
63
+ # :database = Support basic authentication with authentication key + password
64
+ # config.http_authenticatable = false
65
+
66
+ # If 401 status code should be returned for AJAX requests. True by default.
67
+ # config.http_authenticatable_on_xhr = true
68
+
69
+ # The realm used in Http Basic Authentication. 'Application' by default.
70
+ # config.http_authentication_realm = 'Application'
71
+
72
+ # It will change confirmation, password recovery and other workflows
73
+ # to behave the same regardless if the e-mail provided was right or wrong.
74
+ # Does not affect registerable.
75
+ # config.paranoid = true
76
+
77
+ # By default Devise will store the user in session. You can skip storage for
78
+ # particular strategies by setting this option.
79
+ # Notice that if you are skipping storage for all authentication paths, you
80
+ # may want to disable generating routes to Devise's sessions controller by
81
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
82
+ config.skip_session_storage = [:http_auth]
83
+
84
+ # By default, Devise cleans up the CSRF token on authentication to
85
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
86
+ # requests for sign in and sign up, you need to get a new CSRF token
87
+ # from the server. You can disable this option at your own risk.
88
+ # config.clean_up_csrf_token_on_authentication = true
89
+
90
+ # ==> Configuration for :database_authenticatable
91
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
92
+ # using other encryptors, it sets how many times you want the password re-encrypted.
93
+ #
94
+ # Limiting the stretches to just one in testing will increase the performance of
95
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
96
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
97
+ # encryptor), the cost increases exponentially with the number of stretches (e.g.
98
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
99
+ config.stretches = Rails.env.test? ? 1 : 10
100
+
101
+ # Setup a pepper to generate the encrypted password.
102
+ # config.pepper = 'c4c7b5f264ada3352ab74fff3af41b1ef72dc48ecd7e0faefc4d1a9ad9baed82ad4aa06222b58c69e0f2be080e5ebc37755674affe558984be6a8daf4b0e87b2'
103
+
104
+ # ==> Configuration for :confirmable
105
+ # A period that the user is allowed to access the website even without
106
+ # confirming their account. For instance, if set to 2.days, the user will be
107
+ # able to access the website for two days without confirming their account,
108
+ # access will be blocked just in the third day. Default is 0.days, meaning
109
+ # the user cannot access the website without confirming their account.
110
+ # config.allow_unconfirmed_access_for = 2.days
111
+
112
+ # A period that the user is allowed to confirm their account before their
113
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
114
+ # their account within 3 days after the mail was sent, but on the fourth day
115
+ # their account can't be confirmed with the token any more.
116
+ # Default is nil, meaning there is no restriction on how long a user can take
117
+ # before confirming their account.
118
+ # config.confirm_within = 3.days
119
+
120
+ # If true, requires any email changes to be confirmed (exactly the same way as
121
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
122
+ # db field (see migrations). Until confirmed, new email is stored in
123
+ # unconfirmed_email column, and copied to email column on successful confirmation.
124
+ config.reconfirmable = true
125
+
126
+ # Defines which key will be used when confirming an account
127
+ # config.confirmation_keys = [:email]
128
+
129
+ # ==> Configuration for :rememberable
130
+ # The time the user will be remembered without asking for credentials again.
131
+ # config.remember_for = 2.weeks
132
+
133
+ # Invalidates all the remember me tokens when the user signs out.
134
+ config.expire_all_remember_me_on_sign_out = true
135
+
136
+ # If true, extends the user's remember period when remembered via cookie.
137
+ # config.extend_remember_period = false
138
+
139
+ # Options to be passed to the created cookie. For instance, you can set
140
+ # secure: true in order to force SSL only cookies.
141
+ # config.rememberable_options = {}
142
+
143
+ # ==> Configuration for :validatable
144
+ # Range for password length.
145
+ config.password_length = 8..72
146
+
147
+ # Email regex used to validate email formats. It simply asserts that
148
+ # one (and only one) @ exists in the given string. This is mainly
149
+ # to give user feedback and not to assert the e-mail validity.
150
+ # config.email_regexp = /\A[^@]+@[^@]+\z/
151
+
152
+ # ==> Configuration for :timeoutable
153
+ # The time you want to timeout the user session without activity. After this
154
+ # time the user will be asked for credentials again. Default is 30 minutes.
155
+ # config.timeout_in = 30.minutes
156
+
157
+ # If true, expires auth token on session timeout.
158
+ # config.expire_auth_token_on_timeout = false
159
+
160
+ # ==> Configuration for :lockable
161
+ # Defines which strategy will be used to lock an account.
162
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
163
+ # :none = No lock strategy. You should handle locking by yourself.
164
+ # config.lock_strategy = :failed_attempts
165
+
166
+ # Defines which key will be used when locking and unlocking an account
167
+ # config.unlock_keys = [:email]
168
+
169
+ # Defines which strategy will be used to unlock an account.
170
+ # :email = Sends an unlock link to the user email
171
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
172
+ # :both = Enables both strategies
173
+ # :none = No unlock strategy. You should handle unlocking by yourself.
174
+ # config.unlock_strategy = :both
175
+
176
+ # Number of authentication tries before locking an account if lock_strategy
177
+ # is failed attempts.
178
+ # config.maximum_attempts = 20
179
+
180
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
181
+ # config.unlock_in = 1.hour
182
+
183
+ # Warn on the last attempt before the account is locked.
184
+ # config.last_attempt_warning = true
185
+
186
+ # ==> Configuration for :recoverable
187
+ #
188
+ # Defines which key will be used when recovering the password for an account
189
+ # config.reset_password_keys = [:email]
190
+
191
+ # Time interval you can reset your password with a reset password key.
192
+ # Don't put a too small interval or your users won't have the time to
193
+ # change their passwords.
194
+ config.reset_password_within = 6.hours
195
+
196
+ # When set to false, does not sign a user in automatically after their password is
197
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
198
+ # config.sign_in_after_reset_password = true
199
+
200
+ # ==> Configuration for :encryptable
201
+ # Allow you to use another encryption algorithm besides bcrypt (default). You can use
202
+ # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
203
+ # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
204
+ # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
205
+ # REST_AUTH_SITE_KEY to pepper).
206
+ #
207
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
208
+ # config.encryptor = :sha512
209
+
210
+ # ==> Scopes configuration
211
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
212
+ # "users/sessions/new". It's turned off by default because it's slower if you
213
+ # are using only default views.
214
+ # config.scoped_views = false
215
+
216
+ # Configure the default scope given to Warden. By default it's the first
217
+ # devise role declared in your routes (usually :user).
218
+ # config.default_scope = :user
219
+
220
+ # Set this configuration to false if you want /users/sign_out to sign out
221
+ # only the current scope. By default, Devise signs out all scopes.
222
+ # config.sign_out_all_scopes = true
223
+
224
+ # ==> Navigation configuration
225
+ # Lists the formats that should be treated as navigational. Formats like
226
+ # :html, should redirect to the sign in page when the user does not have
227
+ # access, but formats like :xml or :json, should return 401.
228
+ #
229
+ # If you have any extra navigational formats, like :iphone or :mobile, you
230
+ # should add them to the navigational formats lists.
231
+ #
232
+ # The "*/*" below is required to match Internet Explorer requests.
233
+ # config.navigational_formats = ['*/*', :html]
234
+
235
+ # The default HTTP method used to sign out a resource. Default is :delete.
236
+ config.sign_out_via = :delete
237
+
238
+ # ==> OmniAuth
239
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
240
+ # up on your models and hooks.
241
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
242
+
243
+ # ==> Warden configuration
244
+ # If you want to use other strategies, that are not supported by Devise, or
245
+ # change the failure app, you can configure them inside the config.warden block.
246
+ #
247
+ # config.warden do |manager|
248
+ # manager.intercept_401 = false
249
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
250
+ # end
251
+
252
+ # ==> Mountable engine configurations
253
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
254
+ # is mountable, there are some extra configurations to be taken into account.
255
+ # The following options are available, assuming the engine is mounted as:
256
+ #
257
+ # mount MyEngine, at: '/my_engine'
258
+ #
259
+ # The router that invoked `devise_for`, in the example above, would be:
260
+ # config.router_name = :my_engine
261
+ #
262
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
263
+ # so you need to do it manually. For the users scope, it would be:
264
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
265
+ end
@@ -0,0 +1,60 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password has been changed successfully. You are now signed in."
34
+ updated_not_active: "Your password has been changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
42
+ updated: "Your account has been updated successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ already_signed_out: "Signed out successfully."
47
+ unlocks:
48
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
49
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
50
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
51
+ errors:
52
+ messages:
53
+ already_confirmed: "was already confirmed, please try signing in"
54
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
55
+ expired: "has expired, please request a new one"
56
+ not_found: "not found"
57
+ not_locked: "was not locked"
58
+ not_saved:
59
+ one: "1 error prohibited this %{resource} from being saved:"
60
+ other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -1,4 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
- mount LadyJosephine::Engine => "/lady_josephine"
3
+ devise_for :users
4
+ mount LadyJosephine::Engine, at: "/josephine"
5
+
4
6
  end
Binary file
@@ -0,0 +1,9 @@
1
+ class CreateArticles < ActiveRecord::Migration
2
+ def change
3
+ create_table :articles do |t|
4
+ t.string :title
5
+
6
+ t.timestamps null: false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddLadyJosephineToArticles < ActiveRecord::Migration
2
+ def change
3
+ add_column :articles, :content_data, :string, default: "{}"
4
+ add_column :articles, :lady_josephine_ping_date, :timestamp
5
+ add_column :articles, :lady_josephine_ping_user_id, :integer
6
+ add_column :articles, :lady_josephine_server_uuid, :string
7
+ add_column :articles, :lady_josephine_server_version, :string
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :first_name
5
+ t.string :last_name
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,49 @@
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, null: false
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
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+
34
+ # Uncomment below if timestamps were not included in your original model.
35
+ # t.timestamps null: false
36
+ end
37
+
38
+ add_index :users, :email, unique: true
39
+ add_index :users, :reset_password_token, unique: true
40
+ # add_index :users, :confirmation_token, unique: true
41
+ # add_index :users, :unlock_token, unique: true
42
+ end
43
+
44
+ def self.down
45
+ # By default, we don't want to make any assumption about how to roll back a migration when your
46
+ # model already existed. Please edit below which fields you would like to remove in this migration.
47
+ raise ActiveRecord::IrreversibleMigration
48
+ end
49
+ end
@@ -11,6 +11,49 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 0) do
14
+ ActiveRecord::Schema.define(version: 20160308131853) do
15
+
16
+ create_table "articles", force: :cascade do |t|
17
+ t.string "title"
18
+ t.datetime "created_at", null: false
19
+ t.datetime "updated_at", null: false
20
+ t.string "content_data", default: "{}"
21
+ t.datetime "lady_josephine_ping_date"
22
+ t.integer "lady_josephine_ping_user_id"
23
+ t.string "lady_josephine_server_uuid"
24
+ t.string "lady_josephine_server_version"
25
+ end
26
+
27
+ create_table "lady_josephine_images", force: :cascade do |t|
28
+ t.string "block_uuid"
29
+ t.string "file"
30
+ t.string "uploadable_type"
31
+ t.string "uploadable_uuid"
32
+ t.integer "uploadable_id"
33
+ t.string "uploadable_attribute"
34
+ t.text "file_metadata"
35
+ t.datetime "created_at", null: false
36
+ t.datetime "updated_at", null: false
37
+ end
38
+
39
+ create_table "users", force: :cascade do |t|
40
+ t.string "first_name"
41
+ t.string "last_name"
42
+ t.datetime "created_at", null: false
43
+ t.datetime "updated_at", null: false
44
+ t.string "email", default: "", null: false
45
+ t.string "encrypted_password", default: "", null: false
46
+ t.string "reset_password_token"
47
+ t.datetime "reset_password_sent_at"
48
+ t.datetime "remember_created_at"
49
+ t.integer "sign_in_count", default: 0, null: false
50
+ t.datetime "current_sign_in_at"
51
+ t.datetime "last_sign_in_at"
52
+ t.string "current_sign_in_ip"
53
+ t.string "last_sign_in_ip"
54
+ end
55
+
56
+ add_index "users", ["email"], name: "index_users_on_email", unique: true
57
+ add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
15
58
 
16
59
  end
Binary file