iatelier 0.3.2 → 0.4.0

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: e0fc31bf6898d8fcf99621908f5baece31f45729e2d3876e8456e4e205e5bce2
4
- data.tar.gz: 904f2745c009ea98277feb78d61ff63abf49d0fcb8fb05c28beadceb701ac74e
3
+ metadata.gz: 41642a576c00cfcbae058d049b580cecdc53021ea5d3a9ad9b6f20753594e812
4
+ data.tar.gz: 466c0174268b73872507103aa27e3def5754353dfe795b70e652dd7946507e9a
5
5
  SHA512:
6
- metadata.gz: 1e8cef1f2877f1e78e64053add05fe2e063ddd3752d8b70b9c00156708ebea3892b33df75a33e7258b25491e048ffe6ef01001803c97454394ccb472cf767fbf
7
- data.tar.gz: f95fd176e3d41a860137bac0dc24ea7f3575a5525f169aae4299c7ec69baf168c012c92e30a18d3128003e75c25f555612f775201f32e42bb5cb6d403401aa67
6
+ metadata.gz: 11edb222a516e1c0eb362ccf814cbcf78f1c902d9628b883424ed32bcf04a205ae333f1531ab81634879bda6c4cd12d714f8f3260f9b9bd7ffd23ead48339c9b
7
+ data.tar.gz: c66ab84ef004c755aaf3b733cc500ce854fcb5ecffb4d5f94e74527b8368e5237894715fcf46468212b3d2e84c1c8704ad1174b9834b45538963ad2ec1c69907
@@ -2,10 +2,9 @@ require 'redcarpet'
2
2
 
3
3
  class Book < ActiveRecord::Base
4
4
  self.abstract_class = true
5
-
6
- @@dimensions = []
7
- @@groupings = []
8
- @@roles = []
5
+ DIMENSIONS = []
6
+ GROUPINGS = []
7
+ ROLES = []
9
8
 
10
9
  @content_raw = ''
11
10
 
@@ -41,24 +40,13 @@ class Book < ActiveRecord::Base
41
40
  end
42
41
 
43
42
  def dimensions
44
- @@dimensions
45
- end
46
- def self.dimensions
47
- @@dimensions
48
- end
49
-
50
- def roles
51
- @@roles
43
+ self.class::DIMENSIONS
52
44
  end
53
- def self.roles
54
- @@roles
55
- end
56
-
57
- def groupings
58
- @@groupings
45
+ def groupings
46
+ self.class::GROUPINGS
59
47
  end
60
- def self.groupings
61
- @@groupings
48
+ def roles
49
+ self.class::ROLES
62
50
  end
63
51
 
64
52
  def individuals requested_role
@@ -83,10 +71,6 @@ class Book < ActiveRecord::Base
83
71
  end
84
72
  end
85
73
 
86
- def self.with_all
87
- self.includes(self.dimensions + self.groupings)
88
- end
89
-
90
74
  def content
91
75
  markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
92
76
  markdown.render(self.content_raw)
@@ -95,16 +79,16 @@ class Book < ActiveRecord::Base
95
79
  # def initialized
96
80
  # super()
97
81
  # puts "content of the dimension: \n"
98
- # puts @dimensions.inspect
99
- # @dimensions.each do |dimension|
82
+ # puts Dimensions.inspect
83
+ # Dimensions.each do |dimension|
100
84
  # reference = dimension + able
101
85
  # hasone dimension.to_sym as: reference.to_sym
102
86
  # end
103
87
  # end
104
88
 
105
89
  def create params
106
- puts 'these are the stuff were going to add:' + @@dimensions.to_s
107
- @@dimensions.each do |dimension|
90
+ puts 'these are the stuff were going to add:' + Dimensions.to_s
91
+ Dimensions.each do |dimension|
108
92
  method_name = 'setup_' + dimension
109
93
  self.public_send(method_name.to_sym, params)
110
94
  end
@@ -115,7 +99,7 @@ class Book < ActiveRecord::Base
115
99
  end
116
100
 
117
101
  def revise params
118
- @@dimensions.each do |dimension|
102
+ Dimensions.each do |dimension|
119
103
  if self.public_send(dimension.to_sym)
120
104
  method_name = 'revise_' + dimension
121
105
  else
@@ -123,7 +107,7 @@ class Book < ActiveRecord::Base
123
107
  end
124
108
  self.public_send(method_name.to_sym, params)
125
109
  end
126
- @@dimensions.each do |dimension|
110
+ Dimensions.each do |dimension|
127
111
  self.public_send(dimension.to_sym).save
128
112
  end
129
113
  sync_keywords params
@@ -197,7 +181,7 @@ class Book < ActiveRecord::Base
197
181
  def setup_subtitle params
198
182
  self.build_subtitle({value: params[:subtitle]})
199
183
  end
200
- def revise_title params
184
+ def revise_subtitle params
201
185
  self.subtitle.update(value: params[:subtitle])
202
186
  end
203
187
 
@@ -16,7 +16,6 @@
16
16
  -if book.dimensions.include? 'description'
17
17
  %label.label Description
18
18
  %input{:class => "form-control pure-input-1", :name => "description", :type => "text", :placeholder => "Description", :value => book.description.try(:value)}
19
-
20
19
  .form-box
21
20
  %label Text
22
21
  %textarea{:name => "content", :class => "text-editor pure-input-1 form-control", :type => "text", :placeholder => "Content of the book ..."}
@@ -1,3 +1,3 @@
1
1
  module Iatelier
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iatelier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Captain Husayn Pinguin