abstracted 0.1.1 → 0.1.2

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: a36e927d83eabb37b7c1c75d3cf32ff989189eb5
4
- data.tar.gz: 3cd2541a170241929c61fb83e9a542125f78a534
3
+ metadata.gz: 18399c8acfa9c24fec9a1715b2cc7c745f18e6c9
4
+ data.tar.gz: 9de54f97a953ae108bd356d98e52ed3d5242fd00
5
5
  SHA512:
6
- metadata.gz: 72f67a0d8706bf2e3e091e9f794f00c7c204a5a30be2afa39dac23ee298f7e90ceea0727ae48d25d8a3fa630777353262ee8c054e1f5a692729ae4f345dadc6d
7
- data.tar.gz: 9902f7543e18a12abdafcb00150c6ae5375fb4bd9b1b655bf5260910cfaac4fa4f47712ada81d05ab0dabd696a858400355310353b91585764cc16d0a1fd5250
6
+ metadata.gz: 2fb588b20e86b96fc179543581fccc5df1d3cf977b7b9787ba1f1b87746dad2c6cbd54e9dbb4d2fc74899d77928162b57809f6aa3eb9fd3f953c2fa213a28ebb
7
+ data.tar.gz: ccd6d39614493067145a22780100a0376db7f0c6bedf59abac9c7dd99a3bf929b52c81762e5ced3552fe5c7e7cc4e1105dd70a9e990db9c4e4d2631984d478f3
@@ -0,0 +1,26 @@
1
+ #
2
+ # App is the (only) global object
3
+ #
4
+ # reacts to 'app.something' events
5
+ #
6
+ window.App ||= { name: 'App'}
7
+
8
+ App.trigger = (event) ->
9
+ $(App).trigger(event)
10
+
11
+ #
12
+ #
13
+ App.init = ->
14
+ #
15
+ # $( document ).trigger( "page:change" )
16
+ #
17
+ # $(document).on 'page:change', ->
18
+ # console.log 'page changed on event'
19
+ App.trigger('app:init')
20
+ console.log 'app initialized'
21
+
22
+ #
23
+ # standard triggers - and actions
24
+ #
25
+ $(App).on 'app:modal:open', ->
26
+ window.ReactRailsUJS.mountComponents()
@@ -252,8 +252,9 @@ inputForm = null
252
252
  #
253
253
  @prepareUpload = (e) ->
254
254
  if $('.dropbox').size() > 0
255
- medium = new Medium()
256
- medium.initializeBindings()
255
+ a=1
256
+ #medium = new Medium()
257
+ #medium.initializeBindings()
257
258
 
258
259
 
259
260
  #
@@ -254,7 +254,9 @@ class AbstractResourcesController < ApplicationController
254
254
  def new_resource
255
255
  return nil if resource_class.nil?
256
256
  return resource_class.new if resource_class.ancestors.include?( ActiveRecord::Base ) and !(params.include? resource_class.to_s.underscore) #[ 'create', 'update' ].include? params[:action]
257
- return resource_class.new(resource_params.merge(current_user: current_user)) if resource_class.ancestors.include? ActiveRecord::Base
257
+ p = resource_params
258
+ p=p.compact.first if p.class==Array
259
+ return resource_class.new(p.merge(current_user: current_user)) if resource_class.ancestors.include? ActiveRecord::Base
258
260
  nil
259
261
  rescue Exception => e
260
262
  scoop_from_error e
@@ -521,7 +523,8 @@ class AbstractResourcesController < ApplicationController
521
523
  elems.delete :action
522
524
  arr = elems.keys.first.to_s.split("_")
523
525
  return nil unless arr.include? "id"
524
- arr[0].singularize.classify.constantize.find(elems.values.first)
526
+ arr.pop
527
+ arr.join("_").singularize.classify.constantize.find(elems.values.first)
525
528
  rescue
526
529
  nil
527
530
  end
@@ -1,3 +1,3 @@
1
1
  module Abstracted
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abstracted
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Walther H Diechmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-14 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -271,6 +271,7 @@ files:
271
271
  - app/assets/javascripts/abstract_resources.js
272
272
  - app/assets/javascripts/abstracted/.keep
273
273
  - app/assets/javascripts/crud.js.coffee
274
+ - app/assets/javascripts/init.js.coffee
274
275
  - app/assets/javascripts/initializers.js.coffee
275
276
  - app/assets/javascripts/pagescrolling.js.coffee
276
277
  - app/assets/stylesheets/abstract_resources.css