infopark_reactor 1.20.4 → 1.21.0
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 +4 -4
- data/config/routes.rb +0 -4
- data/lib/reactor/version.rb +1 -1
- metadata +2 -3
- data/app/controllers/reactor_controller.rb +0 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f35e35f0ecfa2b74de999bafe9d0ee45cfd0bd81
|
4
|
+
data.tar.gz: 05052d21962fab3f8a00a0ba3e77bfa8c9ec0e01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcb9564641d388d23dfaa8ac34027d53eb2a0ecaa1ec53817d9102adba25b0d838b5e772ba20b66b3a418802a756a8d65707d490e7364f97d0afbd8cf218cab3
|
7
|
+
data.tar.gz: 10e2af5abdb3cf1d797c02c2dc9a0084105305c724790c7d33b3b12c12f2a85459dacdc1aeef9cc4a9c2710bc453e53802caf97dc62335b9919ce447a353b4a4
|
data/config/routes.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
Rails.application.routes.draw do
|
3
|
-
post 'reactor/object' => 'reactor#create_object', :as => :create_object
|
4
|
-
post 'reactor/release/:id' => 'reactor#release_object', :as => :release_object
|
5
|
-
delete 'reactor/object/:id' => 'reactor#delete_object', :as => :delete_object
|
6
|
-
put 'reactor/object/:id' => 'reactor#update_object', :as => :update_object
|
7
3
|
end
|
data/lib/reactor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infopark_reactor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomasz Przedmojski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -98,7 +98,6 @@ files:
|
|
98
98
|
- Gemfile
|
99
99
|
- LICENSE
|
100
100
|
- Rakefile
|
101
|
-
- app/controllers/reactor_controller.rb
|
102
101
|
- app/models/rails_connector/abstract_model.rb
|
103
102
|
- app/models/rails_connector/abstract_obj.rb
|
104
103
|
- app/models/rails_connector/attribute.rb
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
class ReactorController < ApplicationController
|
3
|
-
def create_object
|
4
|
-
obj_data = params[:obj] || {}
|
5
|
-
obj_class = obj_data.delete("obj_class")
|
6
|
-
parent_id = obj_data.delete("parent_id").to_i
|
7
|
-
name = obj_data.delete("name")
|
8
|
-
|
9
|
-
o = Obj.new(:obj_class => obj_class, :name => name, :parent => parent_id) do |obj|
|
10
|
-
obj.send(:reload_attributes, obj_class)
|
11
|
-
obj.update_attributes!(obj_data)
|
12
|
-
end
|
13
|
-
respond_to do |format|
|
14
|
-
format.html { redirect_to(cms_path(o)) }
|
15
|
-
format.json { render :json => o }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def release_object
|
20
|
-
obj = Obj.find(params[:id])
|
21
|
-
obj.release!
|
22
|
-
success = true
|
23
|
-
rescue => e
|
24
|
-
flash[:error] = "#{e.class}\n\n#{e.message}"
|
25
|
-
success = false
|
26
|
-
ensure
|
27
|
-
respond_to do |format|
|
28
|
-
format.html { redirect_to(:back) }
|
29
|
-
if success
|
30
|
-
format.json { render :json => :ok }
|
31
|
-
else
|
32
|
-
format.json { render :json => flash[:error], :status => :unprocessable_entity } # something smarter would be nice
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def update_object
|
38
|
-
obj = Obj.find(params[:id])
|
39
|
-
obj.update_attributes!(params[:obj])
|
40
|
-
respond_to do |format|
|
41
|
-
format.html { redirect_to(:back) }
|
42
|
-
format.json { render :json => :ok }
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def delete_object
|
47
|
-
obj = Obj.find(params[:id])
|
48
|
-
obj.destroy
|
49
|
-
respond_to do |format|
|
50
|
-
format.html { redirect_to(:back) }
|
51
|
-
format.json { render :json => :ok }
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|