forest_liana 1.5.13 → 1.5.14

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 586585eabfd0c29fb988b7b4311e21510194a8c4
4
- data.tar.gz: 44b4952693b40f0f44bb400e1ced0b7b003ed0ef
3
+ metadata.gz: d465cac650830fd8f71903a65b822f4e3734bccf
4
+ data.tar.gz: be8b133ba5dd8a046b701f95588e77a351f2704f
5
5
  SHA512:
6
- metadata.gz: c6a8af4773c5ad7b71b6c866328d2f40afce872dd6e73b69b7dd38e302f7d79398d3db7a690198b574d5e8f7114b08ccf25e11733b1e90a83b908ae268f1c847
7
- data.tar.gz: 5b0aaa71b64e6362342cf6b52d3a8f1a0d554a762648e2c09f1f72b0328adfcf8187ce89499235d7eeb402f730f931d4c1085573994f0e1a1673b4c670c34ba7
6
+ metadata.gz: 001764f65008472fd615b6fb395916db7eb7a39c0b81140cb4bdf0774ede763fb540751834d74d4ee39d6ae1822549eb568065f02110da74ff0eded4ce341041
7
+ data.tar.gz: 46e2d9c7f17cbfa2ed9ecf46661ac107a7a09ab8bae2f00be40f8ec071225f9adb7d5cc889273971443db0a0977fce0aaf710f548583b43d6d69e531bbf9abd5
@@ -5,6 +5,8 @@ module ForestLiana
5
5
  rescue NameError
6
6
  end
7
7
 
8
+ rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
9
+
8
10
  if Rails::VERSION::MAJOR < 4
9
11
  before_filter :find_resource
10
12
  else
@@ -87,5 +89,9 @@ module ForestLiana
87
89
  .select { |a| SchemaUtils.model_included?(a.klass) }
88
90
  .map { |a| a.name.to_s }
89
91
  end
92
+
93
+ def record_not_found
94
+ head :not_found
95
+ end
90
96
  end
91
97
  end
@@ -73,12 +73,9 @@ module ForestLiana
73
73
  end
74
74
 
75
75
  def create_factories
76
- SchemaUtils.tables_names.map do |table_name|
77
- model = SchemaUtils.find_model_from_table_name(table_name)
78
- if analyze_model?(model)
79
- ForestLiana::SerializerFactory.new.serializer_for(model)
80
- ForestLiana::ControllerFactory.new.controller_for(model)
81
- end
76
+ ForestLiana.models.map do |model|
77
+ ForestLiana::SerializerFactory.new.serializer_for(model)
78
+ ForestLiana::ControllerFactory.new.controller_for(model)
82
79
  end
83
80
 
84
81
  # Monkey patch the find_serializer_class_name method to specify the
@@ -117,9 +114,7 @@ module ForestLiana
117
114
  end
118
115
 
119
116
  def create_apimap
120
- SchemaUtils.tables_names.map do |table_name|
121
- model = SchemaUtils.find_model_from_table_name(table_name)
122
-
117
+ ForestLiana.models.map do |model|
123
118
  if analyze_model?(model)
124
119
  SchemaAdapter.new(model).perform
125
120
  end
@@ -19,8 +19,7 @@ module ForestLiana
19
19
 
20
20
  config.middleware.insert_before 0, rack_cors_class do
21
21
  allow do
22
- hostnames = ['localhost:4200', 'app.forestadmin.com',
23
- 'www.forestadmin.com']
22
+ hostnames = ['localhost:4200', /\A.*\.forestadmin\.com\z/]
24
23
  hostnames += ENV['CORS_ORIGINS'].split(',') if ENV['CORS_ORIGINS']
25
24
 
26
25
  origins hostnames
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "1.5.13"
2
+ VERSION = "1.5.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.13
4
+ version: 1.5.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-13 00:00:00.000000000 Z
11
+ date: 2017-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails