ccls-common_lib 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +1 -1
- data/lib/common_lib/action_view_extension/base.rb +2 -1
- data/lib/common_lib/active_record/base.rb +22 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c5934e4ece97a6567e092bd547b2ae3e44e7303
|
4
|
+
data.tar.gz: 26589f9dabf0336ef79fbb0655c2a3dca0955f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f67d10bd315d3516b0d68fe55e4b9143bb1973a94c75b80c349d4f5a2a8651453a73adbe59631176681a3391257ce54fcc3a84bd22bc714c686b42370718e51f
|
7
|
+
data.tar.gz: fdb94ec90840ac18c67b5e4f5a461654dc2f7838a883045ceab501b4939b98dd66340fe10315eea8d01169b06a092c507f440f4fd961d6901028d96ef6520ac6
|
data/README.rdoc
CHANGED
@@ -95,7 +95,7 @@ Or ...
|
|
95
95
|
|
96
96
|
sudo /opt/local/share/mariadb/support-files/mysql.server start
|
97
97
|
|
98
|
-
c ; /bin/rm -rf coverage* ; bundle exec rake ; mv coverage coverage-one-run ; open coverage-one-run/index.html ; nice +20 bundle exec autotest
|
98
|
+
c ; /bin/rm -rf coverage* ; bundle exec rake ; mv coverage coverage-one-run ; open coverage-one-run/index.html ; nice +20 bundle exec autotest -v --no-full-after-failed
|
99
99
|
|
100
100
|
|
101
101
|
---
|
@@ -191,7 +191,8 @@ module CommonLib::ActionViewExtension::Base
|
|
191
191
|
|
192
192
|
def aws_image_tag(image,options={})
|
193
193
|
# in console @controller is nil
|
194
|
-
|
194
|
+
# rails 4 this seems to be controller not @controller now
|
195
|
+
protocol = controller.try(:request).try(:protocol) || 'http://'
|
195
196
|
host = 's3.amazonaws.com/'
|
196
197
|
# bucket = ( defined?(RAILS_APP_NAME) && RAILS_APP_NAME ) || 'ccls'
|
197
198
|
bucket = ( defined?(RAILS_APP_NAME) && RAILS_APP_NAME ) ||
|
@@ -1,5 +1,26 @@
|
|
1
1
|
class ActiveRecord::Base
|
2
2
|
|
3
|
+
# def self.inherited(subclass)
|
4
|
+
# subclass.class_eval do
|
5
|
+
# validation_file = File.join(Rails.root,"config/validations/#{self.to_s.underscore}.yml")
|
6
|
+
# if File.exists?(validation_file)
|
7
|
+
# h = YAML::load( ERB.new( IO.read( validation_file )).result)
|
8
|
+
#
|
9
|
+
# # if the yml file is empty, h is false ( added "if h" condition )
|
10
|
+
# h.each do |validation|
|
11
|
+
# attributes=[validation.delete(:attributes), validation.delete(:attribute)
|
12
|
+
# ].compact.flatten
|
13
|
+
# self.validates *attributes, validation
|
14
|
+
# end if h
|
15
|
+
# end
|
16
|
+
# end
|
17
|
+
# super
|
18
|
+
# end
|
19
|
+
#
|
20
|
+
# This will need some thought. Some of my models define things that are called
|
21
|
+
# from within these validations, so need to be defined first. Not sure how to do that.
|
22
|
+
#
|
23
|
+
|
3
24
|
#
|
4
25
|
# I have found that the validations are really cluttering up the models.
|
5
26
|
# Moving them into a yml file and pulling them in like so seems to
|
@@ -20,6 +41,7 @@ class ActiveRecord::Base
|
|
20
41
|
# I really like this and I may very well make it a default at some point.
|
21
42
|
#
|
22
43
|
def self.validations_from_yaml_file
|
44
|
+
# warn "validations_from_yaml_file is now a default from common_lib. You can remove the call from your model."
|
23
45
|
validation_file = File.join(Rails.root,"config/validations/#{self.to_s.underscore}.yml")
|
24
46
|
if File.exists?(validation_file)
|
25
47
|
h = YAML::load( ERB.new( IO.read( validation_file )).result)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ccls-common_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George 'Jake' Wendt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: CCLS Common Lib gem
|
14
14
|
email: github@jakewendt.com
|