backframe 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: 5726b8cd4eb3674686b05b565f9f6ba362b8e337
4
- data.tar.gz: f9b8e22ba9be82a8184d2472edc64c6223f44b43
3
+ metadata.gz: 1deb27bbff63479a0ba3ecae41f0ab8e61ab5dfd
4
+ data.tar.gz: 05d88ad179a7ceff72019d9f154d4d5a64eaf3a2
5
5
  SHA512:
6
- metadata.gz: b1cddf7acb4ab3c677356aba55606e9db0eaa1a1bffa3c7e309cd3de80f6dbf604b3ec265290e7007f287b0da36d27a9270f5b384c66196eefcfdb9e09f6c643
7
- data.tar.gz: d30448041d9754382be1a1d7f8e49b0141606a8e5e5aca06cd846feef85b71cb3fb3fd265ae3193bf299557013ea245ff73f60032f70fae1368d512f93085e15
6
+ metadata.gz: a89ad1c1b5ec4633115edb1cc72806543f6d386b442c4ab49e0c85e3e50498de0339db4ad871299f34d5c68744512bf64dacc5b830c3bd971935c5843e6ba522
7
+ data.tar.gz: 9f642996c213589a3961909c7f776c0f0cc93bf2fe3ae9b6875f0672002da0e7a9449222e9ff43aa9c07e294975b9084629ddd62086861b75918390a042b36a8
@@ -41,6 +41,7 @@ module Backframe
41
41
  format.json {
42
42
  fields = (args.key?(:fields)) ? args[:fields].split(',').map(&:to_sym) : serializer._attributes
43
43
  render json: collection,
44
+ each_serializer: serializer,
44
45
  content_type: 'application/json',
45
46
  adapter: Backframe::ActsAsAPI::Adapter,
46
47
  fields: fields,
@@ -12,7 +12,11 @@ module Backframe
12
12
 
13
13
  attr_accessor :password, :change_password, :set_password, :old_password, :new_password, :confirm_password, :confirm_email
14
14
 
15
+ has_many :activations, :dependent => :destroy
16
+ has_many :resets, :dependent => :destroy
17
+
15
18
  after_validation :set_new_password, :if => Proc.new { |u| u.new_password.present? }
19
+ after_create :activate
16
20
 
17
21
  validates_presence_of :first_name, :last_name, :email
18
22
  validates_uniqueness_of :email
@@ -75,6 +79,14 @@ module Backframe
75
79
  self.password = self.new_password
76
80
  end
77
81
 
82
+ def activate
83
+ self.activations.create
84
+ end
85
+
86
+ def reset
87
+ self.resets.create
88
+ end
89
+
78
90
  EOV
79
91
 
80
92
  end
@@ -2,7 +2,11 @@ module Backframe
2
2
  module Migration
3
3
  extend ActiveSupport::Concern
4
4
 
5
- class_methods do
5
+ def self.included(base)
6
+ base.send :extend, ClassMethods
7
+ end
8
+
9
+ module ClassMethods
6
10
 
7
11
  def add_foreign_key_index(from, to, column)
8
12
  add_foreign_key(from, to, :column => column)
@@ -1,3 +1,3 @@
1
1
  module Backframe
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
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.8
4
+ version: 0.0.9
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-05 00:00:00.000000000 Z
12
+ date: 2016-05-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: write_xlsx