abstracted 0.3.4 → 0.4.1

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.
@@ -1,3 +1,4 @@
1
+
1
2
  class AbstractResource < ActiveRecord::Base
2
3
  self.abstract_class=true
3
4
 
@@ -36,7 +37,7 @@ class AbstractResource < ActiveRecord::Base
36
37
  end
37
38
 
38
39
  # depreciated ------------ 12/3/2016
39
- #
40
+ #
40
41
  # ancestry related methods - find them on AncestryAbstractResource
41
42
  # def self.arrange_array(options={}, hash=nil)
42
43
  # hash ||= arrange(options)
@@ -62,65 +63,6 @@ class AbstractResource < ActiveRecord::Base
62
63
  # include Exceptions
63
64
  include PrintEngine unless Rails.env=='test'
64
65
  #
65
- #
66
- #
67
- # # list_title
68
- # def list_title
69
- # self.respond_to?( "name") ? self.name : "please define list_title on model (#{self.class.to_s})!"
70
- # end
71
- #
72
- # # implement on relevant models
73
- def find_template paper="A4"
74
- raise 'you have to implement "def find_template(paper)" on your Model'
75
- # 'label.html.haml'
76
- end
77
- #
78
- # def print_label options={}
79
- # params = {}
80
- # params[:print_job] = {}
81
- # params[:print_job][:view_template_path] = options[:template] || default_label_template
82
- # params[:print_job][:print_driver] = options[:print_driver] || :cab
83
- # params[:print_job][:print_format] = options[:print_format] || 'label'
84
- # params[:print_job][:paper] = options[:paper] || "Pakkelabel"
85
- # params[:printer_name] = options[:printer_name]
86
- # params[:user] = options[:user]
87
- # self.class.print [self], params
88
- # end
89
- #
90
- def print_record(options={})
91
- params = {}
92
- params[:context] = options[:context]
93
- template = options[:template]
94
- options = options[:params]
95
- params[:print_job] = {}
96
- params[:print_job][:download] = options[:download] || false
97
- params[:print_job][:print_driver] = options[:print_driver] || :pdf
98
- params[:print_job][:print_format] = options[:print_format] || 'sheet'
99
- params[:print_job][:paper] = options[:paper] || "A4"
100
- params[:print_job][:view_template_path] = template || self.find_template( options[:paper] )
101
- params[:printer_name] = options[:printer_name]
102
- params[:user] = options[:user]
103
- pj = self.class.print [self], params
104
- end
105
- #
106
- def self.print_list(options={})
107
- params = {}
108
- params[:context] = options[:context]
109
- template = options[:template]
110
- options = options[:params]
111
- params[:print_job] = {}
112
- params[:print_job][:download] = options[:download] || false
113
- params[:print_job][:print_driver] = options[:print_driver] || :pdf
114
- params[:print_job][:print_format] = options[:print_format] || 'list'
115
- params[:print_job][:paper] = options[:paper] || "A4"
116
- params[:print_job][:view_template_path] = template || self.find_template( options[:paper] )
117
-
118
- params[:printer_name] = options[:printer_name]
119
- params[:user] = options[:user]
120
- self.print options[:resources], params
121
- end
122
- #
123
-
124
66
 
125
67
  # # add the child to an association of children
126
68
  # !! remember to implement before_save action on *able tables to meet further foreign_key conditions like account_id, etc
@@ -1,3 +1,3 @@
1
1
  module Abstracted
2
- VERSION = "0.3.4"
2
+ VERSION = "0.4.1"
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.3.4
4
+ version: 0.4.1
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-03-13 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails