fl 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/application_controller.rb +1 -1
- data/app/lib/active_record/concerns/base.rb +10 -2
- data/db/migrate/20160616060637_create_nodes.rb +1 -5
- data/db/migrate/20160707080248_create_users.rb +1 -1
- data/db/migrate/20160707094704_create_slugs.rb +1 -1
- data/db/migrate/20160710095916_create_associations.rb +3 -4
- data/db/migrate/20160713061948_create_profiles.rb +2 -3
- data/db/migrate/20161115101221_create_assets.rb +1 -1
- data/db/migrate/20170725060408_create_active_admin_comments.rb +1 -1
- data/lib/fl/constants.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ae5c44263b4e75e9d1e436402dabda5af828e20
|
4
|
+
data.tar.gz: 782964b24d98bab2104e05ff6a7849180d7ad08b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91f844e94458168ff5f87fd7729f7873a00a0ebd354c15684be52ea686b843d2ff49e052d3ff57324e4d05c41c0245149a5a705ed6c87ca1038c0554f7e56a1f
|
7
|
+
data.tar.gz: 8ff4f548e3858f017e47fcc80504bcb0966a6f5d16d0464abfa6ce0e53813622c256ed6b75f3816f37c7da1a948e120c19e5d3ee42f4957d53e63088b88dd977
|
@@ -14,7 +14,7 @@ class ApplicationController < ActionController::Base
|
|
14
14
|
protect_from_forgery with: :exception
|
15
15
|
|
16
16
|
# => Layout
|
17
|
-
layout Proc.new { |c|
|
17
|
+
layout Proc.new { |c| 'base' unless c.request.xhr? }
|
18
18
|
|
19
19
|
# => Maintenance
|
20
20
|
before_action Proc.new { @maintenance = Node.find_by(ref: "maintenance").try(:val) }, only: :show
|
@@ -11,14 +11,22 @@ module ActiveRecord
|
|
11
11
|
ENV["DATABASE_ADAPTER"]
|
12
12
|
end
|
13
13
|
|
14
|
+
#########################################
|
15
|
+
#########################################
|
16
|
+
|
14
17
|
# Down
|
15
18
|
def down
|
16
19
|
drop_table table, if_exists: true
|
17
20
|
end
|
18
21
|
|
19
22
|
# UUID
|
20
|
-
def
|
21
|
-
adapter
|
23
|
+
def options(key=:id)
|
24
|
+
case adapter
|
25
|
+
when "mysql2"
|
26
|
+
{ options: 'DEFAULT CHARSET=utf8' }
|
27
|
+
else
|
28
|
+
{}
|
29
|
+
end
|
22
30
|
end
|
23
31
|
|
24
32
|
# Table
|
@@ -5,12 +5,8 @@ class CreateNodes < ActiveRecord::Migration::Current
|
|
5
5
|
#########################################
|
6
6
|
|
7
7
|
# => Up
|
8
|
-
# => enable_extension for Ruby 2.4.0 on Heroku
|
9
8
|
def up
|
10
|
-
|
11
|
-
|
12
|
-
# => Table
|
13
|
-
create_table table, uuid do |t| # => users stored through "associations"
|
9
|
+
create_table table, options do |t| # => users stored through "associations"
|
14
10
|
t.references :user
|
15
11
|
t.string :type
|
16
12
|
t.string :slug
|
@@ -6,10 +6,9 @@ class CreateAssociations < ActiveRecord::Migration::Current
|
|
6
6
|
|
7
7
|
# Up
|
8
8
|
def up
|
9
|
-
|
10
|
-
|
11
|
-
t.references :
|
12
|
-
t.references :associated, { polymorphic: true }.merge!(uuid(:type)) # => http://stackoverflow.com/a/29257570/1143732
|
9
|
+
create_table table, options do |t|
|
10
|
+
t.references :associatiable, { polymorphic: true } # => http://stackoverflow.com/a/29257570/1143732
|
11
|
+
t.references :associated, { polymorphic: true } # => http://stackoverflow.com/a/29257570/1143732
|
13
12
|
t.timestamps
|
14
13
|
end
|
15
14
|
end
|
@@ -3,11 +3,10 @@ class CreateProfiles < ActiveRecord::Migration::Current
|
|
3
3
|
|
4
4
|
# Up
|
5
5
|
def up
|
6
|
-
|
7
|
-
create_table table, uuid do |t|
|
6
|
+
create_table table, options do |t|
|
8
7
|
|
9
8
|
# => General
|
10
|
-
t.references :user, { references: :user }
|
9
|
+
t.references :user, { references: :user } # => Should be used to create custom references but always adds "_id" to name
|
11
10
|
t.string :slug
|
12
11
|
t.string :name
|
13
12
|
t.integer :role, default: 0
|
data/lib/fl/constants.rb
CHANGED