gourami 0.1.1 → 0.1.2

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: f7d45d0bcf1edbc6a81d3489bab6de5ccd4b0ea2
4
- data.tar.gz: d04dff73bc07b0ad96aa619f11f710b6024b02e9
3
+ metadata.gz: 5a514a33e36dee0b4a2c39ef0320f4a8fa70ab24
4
+ data.tar.gz: 6acabd9872fd0346833fa7f50b527d1413a202f0
5
5
  SHA512:
6
- metadata.gz: 95bbf65d77ce12927bed88dbeab0ceacd4cd9d57654d163e94e827f18623ca39cfb029d5e67d9a56593809c9ebcf27220e273a7ddd70fd451a098c62d35b25b1
7
- data.tar.gz: 10eacdc7e10de57f2daa4c600d331936984753ee5749445c4bbda6e867442a36e14bdb8eb509fa9bbc65f54fcc2baa78d410158ad8c40bac6288cdaff63ac5f2
6
+ metadata.gz: 97e2db4cccf243740e2e1548673df9860a06aeb856516c77e9596bab2ff06c39c86c982266a5cbe24d33b6383d885cc1e4411d0fb934c7570628de2000edbfa7
7
+ data.tar.gz: 15cff403f9f9a2d2a7536278fa114fff0f503e8a13e539546f8ae049d978c76231c71fe7e60c5c65721b4761d2178bd6dd4340be5fbd23f3f472f635a6111f35
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 TSMMark
3
+ Copyright (c) 2017 Vydia, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -46,11 +46,11 @@ end
46
46
 
47
47
  ```ruby
48
48
  def new
49
- @form = CreateFishTank.new
49
+ @form = CreateFishBowl.new
50
50
  end
51
51
 
52
52
  def create
53
- @form = CreateFishTank.new(fish_tank_params)
53
+ @form = CreateFishBowl.new(fish_bowl_params)
54
54
 
55
55
  if @form.valid?
56
56
  @form.perform
@@ -64,9 +64,9 @@ end
64
64
  ### Example of a form that Creates a record
65
65
 
66
66
  ```ruby
67
- class CreateFishTank < Gourami::Form
67
+ class CreateFishBowl < Gourami::Form
68
68
 
69
- record(:fish_tank)
69
+ record(:fish_bowl)
70
70
 
71
71
  attribute(:width, type: :integer)
72
72
  attribute(:height, type: :integer)
@@ -86,12 +86,12 @@ class CreateFishTank < Gourami::Form
86
86
 
87
87
  validate_presence(:name)
88
88
  validate_uniqueness(:name) do |name|
89
- FishTank.where(name: name).empty?
89
+ FishBowl.where(name: name).empty?
90
90
  end
91
91
  end
92
92
 
93
93
  def perform
94
- self.fish_tank = FishTank.create(attributes)
94
+ self.fish_bowl = FishBowl.create(attributes)
95
95
  end
96
96
 
97
97
  end
@@ -101,12 +101,12 @@ end
101
101
 
102
102
  ```ruby
103
103
  def edit
104
- fish_tank = FishTank.find(params[:id])
105
- @form = UpdateFishTank.new_from_record(fish_tank)
104
+ fish_bowl = FishBowl.find(params[:id])
105
+ @form = UpdateFishBowl.new_from_record(fish_bowl)
106
106
  end
107
107
 
108
108
  def update
109
- @form = UpdateFishTank.new(fish_tank_params)
109
+ @form = UpdateFishBowl.new(fish_bowl_params)
110
110
 
111
111
  if @form.valid?
112
112
  @form.perform
@@ -120,9 +120,9 @@ end
120
120
  ### Example of a form that Updates a record
121
121
 
122
122
  ```ruby
123
- class UpdateFishTank < CreateFishTank
123
+ class UpdateFishBowl < CreateFishBowl
124
124
 
125
- record(:fish_tank)
125
+ record(:fish_bowl)
126
126
 
127
127
  attribute(:width, type: :integer)
128
128
  attribute(:height, type: :integer)
@@ -130,8 +130,8 @@ class UpdateFishTank < CreateFishTank
130
130
  attribute(:name, type: :string)
131
131
  attribute(:filter_included, type: :boolean, default: false)
132
132
 
133
- def self.new_from_record(fish_tank)
134
- new({ fish_tank: fish_tank }.merge(fish_tank.attributes))
133
+ def self.new_from_record(fish_bowl)
134
+ new({ fish_bowl: fish_bowl }.merge(fish_bowl.attributes))
135
135
  end
136
136
 
137
137
  def validate
@@ -146,12 +146,12 @@ class UpdateFishTank < CreateFishTank
146
146
 
147
147
  validate_presence(:name)
148
148
  validate_uniqueness(:name) do |name|
149
- FishTank.where(name: name).empty?
149
+ FishBowl.where(name: name).empty?
150
150
  end
151
151
  end
152
152
 
153
153
  def perform
154
- fish_tank.update(attributes)
154
+ fish_bowl.update(attributes)
155
155
  end
156
156
 
157
157
  end
@@ -160,16 +160,16 @@ end
160
160
  #### Or inherit instead of duplicating the attributes and validations
161
161
 
162
162
  ```ruby
163
- class UpdateFishTank < CreateFishTank
163
+ class UpdateFishBowl < CreateFishBowl
164
164
 
165
- # All attributes and validations inherited from CreateFishTank.
165
+ # All attributes and validations inherited from CreateFishBowl.
166
166
 
167
- def self.new_from_record(fish_tank)
168
- new({ fish_tank: fish_tank }.merge(fish_tank.attributes))
167
+ def self.new_from_record(fish_bowl)
168
+ new({ fish_bowl: fish_bowl }.merge(fish_bowl.attributes))
169
169
  end
170
170
 
171
171
  def perform
172
- fish_tank.update(attributes)
172
+ fish_bowl.update(attributes)
173
173
  end
174
174
 
175
175
  end
@@ -183,7 +183,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
183
183
 
184
184
  ## Contributing
185
185
 
186
- Bug reports and pull requests are welcome on GitHub at https://github.com/TSMMark/gourami. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
186
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Vydia/gourami. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
187
187
 
188
188
  ## License
189
189
 
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "gourami"
8
8
  spec.version = Gourami::VERSION
9
9
  spec.authors = ["TSMMark"]
10
- spec.email = ["9thousand@gmail.com"]
10
+ spec.email = ["dev@vydia.com"]
11
11
 
12
12
  spec.summary = %q{Keep your Routes, Controllers and Models thin.}
13
13
  spec.description = %q{Create Plain Old Ruby Objects that take attributes, validate them, and perform an action.}
14
- spec.homepage = "http://github.com/TSMMark/gourami"
14
+ spec.homepage = "http://github.com/Vydia/gourami"
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -1,3 +1,3 @@
1
1
  module Gourami
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gourami
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TSMMark
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -69,7 +69,7 @@ dependencies:
69
69
  description: Create Plain Old Ruby Objects that take attributes, validate them, and
70
70
  perform an action.
71
71
  email:
72
- - 9thousand@gmail.com
72
+ - dev@vydia.com
73
73
  executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
@@ -94,7 +94,7 @@ files:
94
94
  - lib/gourami/validation_error.rb
95
95
  - lib/gourami/validations.rb
96
96
  - lib/gourami/version.rb
97
- homepage: http://github.com/TSMMark/gourami
97
+ homepage: http://github.com/Vydia/gourami
98
98
  licenses:
99
99
  - MIT
100
100
  metadata: {}