backframe 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/lib/backframe/actioncontroller/acts_as_activation.rb +1 -1
- data/lib/backframe/actioncontroller/acts_as_reset.rb +1 -1
- data/lib/backframe/actioncontroller/acts_as_resource.rb +1 -1
- data/lib/backframe/actioncontroller/acts_as_session.rb +1 -1
- data/lib/backframe/activerecord/acts_as_user.rb +1 -1
- data/lib/backframe/activerecord/default_values.rb +32 -0
- data/lib/backframe/railtie.rb +1 -0
- data/lib/backframe/version.rb +1 -1
- data/lib/backframe.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c0d24ab06f49de1e0896bfbb425d52178e8acfd
|
4
|
+
data.tar.gz: f52fdfa058db885a75eb55e98f374190a0b6407a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 540f5dd53eaed8e5d1281ba0bc7000061e2e7d31ba10d971c310198f57b9b905b66059d7a795d44d231461ab016b445688e27706c0cb9514a8d329e98cb936fa
|
7
|
+
data.tar.gz: 45fa7b20bb8deba3a1f8e9f8f5c86faf272fbd65cbcfaac94aab730c0b7e652634abcdad9eb14f804adb8cd917fa1ca7ea1674eb7a43284b5db388cf392d01a2
|
data/Rakefile
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Backframe
|
4
|
+
module DefaultValues
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
def self.included(base)
|
8
|
+
base.send :extend, ClassMethods
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
|
13
|
+
def default_values(*args)
|
14
|
+
|
15
|
+
arguments = args[0] || {}
|
16
|
+
|
17
|
+
after_initialize :set_default_values, :if => Proc.new { |o| o.new_record? }
|
18
|
+
|
19
|
+
class_eval <<-EOV
|
20
|
+
|
21
|
+
def set_default_values
|
22
|
+
self.attributes = #{arguments.symbolize_keys.to_s}
|
23
|
+
end
|
24
|
+
|
25
|
+
EOV
|
26
|
+
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/backframe/railtie.rb
CHANGED
@@ -13,6 +13,7 @@ module Backframe
|
|
13
13
|
ActiveRecord::Base.send(:include, Backframe::ActsAsEnum)
|
14
14
|
ActiveRecord::Base.send(:include, Backframe::ActsAsOrderable)
|
15
15
|
ActiveRecord::Base.send(:include, Backframe::ActsAsUser)
|
16
|
+
ActiveRecord::Base.send(:include, Backframe::DefaultValues)
|
16
17
|
ActiveRecord::Base.send(:include, Backframe::FilterSort)
|
17
18
|
ActiveRecord::Migration.send(:include, Backframe::Migration)
|
18
19
|
Backframe::Mime.register_types
|
data/lib/backframe/version.rb
CHANGED
data/lib/backframe.rb
CHANGED
@@ -15,6 +15,7 @@ require 'backframe/activerecord/acts_as_distinct'
|
|
15
15
|
require 'backframe/activerecord/acts_as_orderable'
|
16
16
|
require 'backframe/activerecord/acts_as_enum'
|
17
17
|
require 'backframe/activerecord/acts_as_user'
|
18
|
+
require 'backframe/activerecord/default_values'
|
18
19
|
require 'backframe/activerecord/filter_sort'
|
19
20
|
require 'backframe/activerecord/migration'
|
20
21
|
require 'backframe/models/activity'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backframe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Kops
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-05-
|
12
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: write_xlsx
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- lib/backframe/activerecord/acts_as_enum.rb
|
111
111
|
- lib/backframe/activerecord/acts_as_orderable.rb
|
112
112
|
- lib/backframe/activerecord/acts_as_user.rb
|
113
|
+
- lib/backframe/activerecord/default_values.rb
|
113
114
|
- lib/backframe/activerecord/filter_sort.rb
|
114
115
|
- lib/backframe/activerecord/migration.rb
|
115
116
|
- lib/backframe/mime.rb
|