rest_rails 1.1.2 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e29c2c9116b0909e3c040933b7817b0721a809c78408b3faf1897c1e8e34971b
4
- data.tar.gz: 9bd2d8871ea043dbea1ef7d2b092b6970e3fa16ac78fc07659ef2accb622c916
3
+ metadata.gz: 81948eac89af4c4791ed9dc755bef3da9c247f131ba516ec441b411d76192e61
4
+ data.tar.gz: 1ca64d35ae1b5dbdf326b1f97e19ffadae14ebe392dbbcd36e668600c3741474
5
5
  SHA512:
6
- metadata.gz: 3fcb45c217ab6040e485783a822520e77f2712277ed592d0320c66375d991f3a030b3a1007bcf1c84f84242f5a5b0d5649c8aa22c36a5a3099ad9bb169efcd13
7
- data.tar.gz: f78055f4c5d5265b1897b3fba61457ad7b92e1661cf3e48733f447d1cb80f1a78bd901405b3b287411566f31b4d981bfab08d5be813115c8fd5ab98c4a205346
6
+ metadata.gz: 7e44cd7f9047bd5dfbc4e7b485716a7669056aa24c1da2b29e830831009010d83691d81cb71066bb997cf7989d3cc129d130b16ab60650aaf7652b13f67e3b89
7
+ data.tar.gz: b2b64cd6d7f29786d74e5ab98b417aed413ff8151277f212e97f4e8fa16d0ad6204423b4447d87e75010f0925dd7eadcd8d6eec7e4c6f227e561878dd955c15a
@@ -9,6 +9,10 @@ module RestRails
9
9
 
10
10
  private
11
11
 
12
+ def verify_authenticity_token
13
+ true
14
+ end
15
+
12
16
  def not_found(exception)
13
17
  if RestRails.debug
14
18
  raise exception
@@ -2,7 +2,7 @@ require 'json'
2
2
  module RestRails
3
3
  class DataController < ::ApplicationController
4
4
  include ApplicationHelper
5
- skip_before_action :verify_authenticity_token
5
+ # skip_before_action :verify_authenticity_token, if: -> {self.respond_to?("verify_authenticity_token")}
6
6
  before_action :verify_table_permissions!, only: [:create, :update, :destroy, :attach, :unattach]
7
7
  before_action :set_model
8
8
  before_action :set_object, only: [:show, :update, :destroy, :fetch_column, :attach, :unattach]
@@ -16,7 +16,7 @@ module RestRails
16
16
  base_query = p_hash.blank? ? @model.all : @model.where(p_hash)
17
17
 
18
18
  @objects = base_query.order(:id).limit(ppage).offset(off)
19
- @objects.map!{|x| standardize_json(x) }
19
+ @objects = @objects.map{|x| standardize_json(x) }
20
20
 
21
21
  render json: {code: 200, objects: @objects, count: @objects.count, total: @model.count}
22
22
  end
@@ -74,7 +74,7 @@ module RestRails
74
74
  tables.map do |x|
75
75
  cols = x.to_s.classify.constantize.column_names.map(&:to_sym)
76
76
  key = "#{x}_attributes".to_sym
77
- cols.delete(:id)
77
+ cols << :_destroy
78
78
 
79
79
  {key => cols}
80
80
  end
@@ -4,6 +4,7 @@ RestRails::Engine.routes.draw do
4
4
 
5
5
  get '/:table_name/:id' => 'data#show', as: 'data_show'
6
6
  patch '/:table_name/:id' => 'data#update'
7
+ put '/:table_name/:id' => 'data#update'
7
8
  delete '/:table_name/:id' => 'data#destroy', as: 'data_destroy'
8
9
 
9
10
  post '/:table_name/:id/attach/:attachment_name' => 'data#attach'
@@ -1,3 +1,3 @@
1
1
  module RestRails
2
- VERSION = '1.1.2'
2
+ VERSION = '1.1.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Rivas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-28 00:00:00.000000000 Z
11
+ date: 2020-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -82,8 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubyforge_project:
86
- rubygems_version: 2.7.6
85
+ rubygems_version: 3.0.3
87
86
  signing_key:
88
87
  specification_version: 4
89
88
  summary: Simple, Mountable, rails REST API