optin 0.3.0 → 0.4.0

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/lib/optin/version.rb +1 -1
  4. data/lib/optin.rb +3 -52
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d5ea67c3f684dd08339670582ac56cfea44cda4
4
- data.tar.gz: cf859d8ba422a3a493e136c80204d373e0e3f99f
3
+ metadata.gz: 5f21bdfbaa6201b119504e357c84354781c1646c
4
+ data.tar.gz: e298b2bfb7dd3885554f22892f7c5581d8392847
5
5
  SHA512:
6
- metadata.gz: 13d7fc4675f4ff18d9083f45bf7e05480d13dace29caed767ae836de6cbeefeb4c0b1fb064011b0570a4b213fba97f9bdb30140af350b011b6c0e6c596076552
7
- data.tar.gz: da5850e1de4798c8aefd9bca04a48bd52e2a98f5089ba7b1c596d02bf5851894370f49d39cf9bb2ff2252a8a556ebe398760a75a1a9d2a571ba32e986ad53233
6
+ metadata.gz: e7c350e9f45a28e3be386d05b0d94eba9e1a2ef6c5ebfb0c34d4367c55f3579b370aa3922632e51e9f40c7cf23cb87e690b390345b43a29bc96c1059da26aedb
7
+ data.tar.gz: feefa65584ba4ea9a1254131a668c0ac644450aa17126d1cb234f40b9496e94e431424567e9b9def554bcdff7b2f322b7d6c0160fe8b1bd9785cc8746641486d
data/Rakefile CHANGED
@@ -6,4 +6,4 @@ RSpec::Core::RakeTask.new(:spec)
6
6
  task :default => :spec
7
7
 
8
8
  require 'sinatra/activerecord/rake'
9
- require './lib/optin'
9
+ require './application'
data/lib/optin/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Optin
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/lib/optin.rb CHANGED
@@ -1,54 +1,5 @@
1
1
  require 'active_record'
2
- require "optin/version"
3
- require 'sinatra'
4
- require 'sinatra/activerecord'
5
- #require 'spec/support/models.rb'
6
-
7
- ActiveRecord::Base.extend Optin
8
-
9
- before { content_type :json }
10
-
11
- #create
12
- post '/optins' do
13
- opt_in = OptIn.new(params[:opt_in])
14
- if opt_in.save
15
- status 200
16
- opt_in.to_json
17
- else
18
- status 500
19
- opt_in.errors.messages.to_json
20
- end
21
- end
22
-
23
- #update
24
- put '/optins/:id' do
25
- opt_in = find_optin_by_id
26
- if opt_in
27
- if opt_in.update_attributes(params[:opt_in])
28
- status 200
29
- opt_in.to_json
30
- else
31
- status 500
32
- opt_in.to_json
33
- end
34
- else
35
- status 404
36
- end
37
- end
38
-
39
- #disable
40
- put '/optins/:id/disable' do
41
- opt_in = find_optin_by_id
42
- if opt_in
43
- opt_in.disable!
44
- status 200
45
- else
46
- status 404
47
- end
48
- end
49
-
50
- def find_optin_by_id
51
- OptIn.find params[:id]
52
- end
53
-
54
2
 
3
+ module Optin
4
+ ActiveRecord::Base.extend Optin
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - olegkonopka