tb_media 1.2.0.beta1 → 1.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 113523e49c829fd56bda7df24ae33a556660fee5
4
- data.tar.gz: f657496378550afd5bcb74b82fb774aee76277b8
3
+ metadata.gz: 2346e4b40486aa8457024ae860e82ddd2f967b23
4
+ data.tar.gz: e7520766aa0f18b3d68a28c7f7eba0f4234fc70c
5
5
  SHA512:
6
- metadata.gz: f603cbb40c6ec92e57797ee3d3b095b3db21f37419e0564caa736dc410506ea60322d1517f147e76d7fc6649d93e563a4c1b50647659169707197bf2bc3a6349
7
- data.tar.gz: 363afcc5f0f28cb0bfd3ec0605d202aad048570998ad48918e08cdb542527f925b20344e324210429c206c4089a3a05702b2e83dabf4caba8fc3ebb6fa1feff0
6
+ metadata.gz: 80ba5cd98b543017db866a4703ff66ec08833cb041f07e4712d71ba3c7940aaacc58b7140b84a74b1de74f6e81f764f0a5ab6337ce5404935829c95b55ec3dba
7
+ data.tar.gz: cc9edb5f94db9708bdb85c909b7966a8b0cda9895c6f1f51d0466490179b6214e161bdc71198cea71ef09f1a642e95808501395eb035f9e297aa3eadea173de2
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Media
3
- VERSION = "1.2.0.beta1"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
- require 'spec_helper'
1
+ require 'rails_helper'
2
2
 
3
- describe Admin::MediaController do
3
+ describe Admin::MediaController, :type => :controller do
4
4
 
5
5
  before :each do
6
6
  activate_authlogic
@@ -10,38 +10,33 @@ describe Admin::MediaController do
10
10
  @user = SpudUserSession.create(u)
11
11
  end
12
12
 
13
- describe :index do
13
+ describe 'index' do
14
14
  it "index page should return all media in descending order by create_at" do
15
15
  @media1 = FactoryGirl.create(:spud_media, created_at: 1.hour.ago)
16
16
  @media2 = FactoryGirl.create(:spud_media, created_at: 2.hours.ago)
17
17
  @media3 = FactoryGirl.create(:spud_media, created_at: 3.hours.ago)
18
18
  get :index
19
19
  @medias = assigns(:media)
20
- @medias.count.should eq(3)
21
- (@medias[0].id).should eq(@media1.id)
22
- (@medias[1].id).should eq(@media2.id)
23
- (@medias[2].id).should eq(@media3.id)
20
+ expect(@medias.count).to eq(3)
21
+ expect((@medias[0].id)).to eq(@media1.id)
22
+ expect((@medias[1].id)).to eq(@media2.id)
23
+ expect((@medias[2].id)).to eq(@media3.id)
24
24
  end
25
25
  end
26
26
 
27
- describe :new do
27
+ describe 'new' do
28
28
  it "should return a new media object" do
29
29
  get :new
30
30
  @media = assigns(:media)
31
- @media.should_not be_blank
32
- @media.id.should be_blank
33
- @media.should be_a_kind_of(SpudMedia)
31
+ expect(@media).to_not be_blank
34
32
  end
35
33
  end
36
34
 
37
- describe :create do
35
+ describe 'create' do
38
36
  it "should create a new media and returned the saved object's edit page" do
39
- post :create, spud_media: Factory.attributes_for(:spud_media)
40
- @media = assigns(:media)
41
- @media.should_not be_blank
42
- response.should redirect_to(edit_admin_medium_path(@media.id))
37
+ post :create, spud_media: FactoryGirl.attributes_for(:spud_media)
43
38
  expect {
44
- post :create, spud_media: Factory.attributes_for(:spud_media)
39
+ post :create, spud_media: FactoryGirl.attributes_for(:spud_media)
45
40
  }.to change(SpudMedia, :count).by(1)
46
41
  end
47
42
  end
@@ -9,7 +9,7 @@ Dummy::Application.configure do
9
9
  config.action_controller.perform_caching = true
10
10
 
11
11
  # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
12
+ config.serve_static_files = false
13
13
 
14
14
  # Compress JavaScripts and CSS
15
15
  config.assets.compress = true
@@ -8,7 +8,7 @@ Dummy::Application.configure do
8
8
  config.cache_classes = true
9
9
 
10
10
  # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
11
+ config.serve_static_files = true
12
12
  config.static_cache_control = "public, max-age=3600"
13
13
 
14
14
  # Do not eager load code on boot. This avoids loading your whole application
@@ -33,4 +33,6 @@ Dummy::Application.configure do
33
33
 
34
34
  # Print deprecation notices to the stderr
35
35
  config.active_support.deprecation = :stderr
36
+
37
+ config.active_record.raise_in_transactional_callbacks = true
36
38
  end
@@ -1,5 +1,13 @@
1
- require 'spec_helper'
1
+ require 'rails_helper'
2
+
3
+ describe SpudMedia, :type => :model do
4
+
5
+ describe 'attachment' do
6
+ it 'should require an attachment' do
7
+ media = FactoryGirl.build(:spud_media, :attachment => nil)
8
+ expect(media.valid?).to eq(false)
9
+ expect(media.errors[:attachment].length).to eq(1)
10
+ end
11
+ end
2
12
 
3
- describe SpudMedia do
4
- it { should validate_presence_of(:attachment) }
5
13
  end
@@ -0,0 +1,71 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require 'spec_helper'
6
+ require 'support/authlogic_helper'
7
+ require 'rspec/rails'
8
+ require 'database_cleaner'
9
+ require 'simplecov'
10
+ require 'factory_girl_rails'
11
+
12
+ SimpleCov.start 'rails'
13
+
14
+ # Add additional requires below this line. Rails is not loaded until this point!
15
+
16
+ # Requires supporting ruby files with custom matchers and macros, etc, in
17
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
18
+ # run as spec files by default. This means that files in spec/support that end
19
+ # in _spec.rb will both be required and run as specs, causing the specs to be
20
+ # run twice. It is recommended that you do not name files matching this glob to
21
+ # end with _spec.rb. You can configure this pattern with the --pattern
22
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
23
+ #
24
+ # The following line is provided for convenience purposes. It has the downside
25
+ # of increasing the boot-up time by auto-requiring all files in the support
26
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
27
+ # require only the support files necessary.
28
+ #
29
+ # Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
30
+
31
+ # Checks for pending migrations before tests are run.
32
+ # If you are not using ActiveRecord, you can remove this line.
33
+ #ActiveRecord::Migration.maintain_test_schema!
34
+
35
+ RSpec.configure do |config|
36
+ config.raise_errors_for_deprecations!
37
+ config.infer_base_class_for_anonymous_controllers = false
38
+
39
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
40
+ # examples within a transaction, remove the following line or assign false
41
+ # instead of true.
42
+ config.use_transactional_fixtures = true
43
+
44
+ # RSpec Rails can automatically mix in different behaviours to your tests
45
+ # based on their file location, for example enabling you to call `get` and
46
+ # `post` in specs under `spec/controllers`.
47
+ #
48
+ # You can disable this behaviour by removing the line below, and instead
49
+ # explicitly tag your specs with their type, e.g.:
50
+ #
51
+ # RSpec.describe UsersController, :type => :controller do
52
+ # # ...
53
+ # end
54
+ #
55
+ # The different available types are documented in the features, such as in
56
+ # https://relishapp.com/rspec/rspec-rails/docs
57
+ # config.infer_spec_type_from_file_location!
58
+
59
+ # Clean the database as needed
60
+ # https://github.com/DatabaseCleaner/database_cleaner#rspec-example
61
+ config.before(:suite) do
62
+ DatabaseCleaner.strategy = :transaction
63
+ DatabaseCleaner.clean_with(:truncation)
64
+ end
65
+ config.around(:each) do |example|
66
+ DatabaseCleaner.cleaning do
67
+ example.run
68
+ end
69
+ end
70
+
71
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,42 +1,85 @@
1
- # Track code coverage
2
- require 'simplecov'
3
- SimpleCov.start 'rails' do
4
- # root "dummy/"
5
- add_filter "/factories/"
6
- end
1
+ # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
+ # file to always be loaded, without a need to explicitly require it in any files.
5
+ #
6
+ # Given that it is always loaded, you are encouraged to keep this file as
7
+ # light-weight as possible. Requiring heavyweight dependencies from this file
8
+ # will add to the boot time of your test suite on EVERY test run, even for an
9
+ # individual file that may not need all of that loaded. Instead, consider making
10
+ # a separate helper file that requires the additional dependencies and performs
11
+ # the additional setup, and require it from the spec files that actually need it.
12
+ #
13
+ # The `.rspec` file also contains a few flags that are not defaults but that
14
+ # users commonly want.
15
+ #
16
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
+ RSpec.configure do |config|
18
+ # rspec-expectations config goes here. You can use an alternate
19
+ # assertion/expectation library such as wrong or the stdlib/minitest
20
+ # assertions if you prefer.
21
+ config.expect_with :rspec do |expectations|
22
+ # This option will default to `true` in RSpec 4. It makes the `description`
23
+ # and `failure_message` of custom matchers include text for helper methods
24
+ # defined using `chain`, e.g.:
25
+ # be_bigger_than(2).and_smaller_than(4).description
26
+ # # => "be bigger than 2 and smaller than 4"
27
+ # ...rather than:
28
+ # # => "be bigger than 2"
29
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
30
+ end
7
31
 
8
- # This file is copied to spec/ when you run 'rails generate rspec:install'
9
- ENV["RAILS_ENV"] = 'test'
10
- require File.expand_path("../dummy/config/environment", __FILE__)
11
- require 'rspec/rails'
12
- require 'rspec/autorun'
13
- require 'database_cleaner'
14
- require 'shoulda'
15
- require 'factory_girl'
16
- #require 'mocha'
17
- require 'capybara/rspec'
18
- require 'capybara/rails'
32
+ # rspec-mocks config goes here. You can use an alternate test double
33
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
34
+ config.mock_with :rspec do |mocks|
35
+ # Prevents you from mocking or stubbing a method that does not exist on
36
+ # a real object. This is generally recommended, and will default to
37
+ # `true` in RSpec 4.
38
+ mocks.verify_partial_doubles = true
39
+ end
19
40
 
20
- # Requires supporting ruby files with custom matchers and macros, etc,
21
- # in spec/support/ and its subdirectories.
22
- ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
23
- Dir[File.join(ENGINE_RAILS_ROOT,"spec/support/**/*.rb"), File.join(ENGINE_RAILS_ROOT,"factories/*")].each {|f| require f}
41
+ # The settings below are suggested to provide a good initial experience
42
+ # with RSpec, but feel free to customize to your heart's content.
43
+ =begin
44
+ # These two settings work together to allow you to limit a spec run
45
+ # to individual examples or groups you care about by tagging them with
46
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
47
+ # get run.
48
+ config.filter_run :focus
49
+ config.run_all_when_everything_filtered = true
24
50
 
25
- RSpec.configure do |config|
26
- #config.mock_with :mocha
27
- config.use_transactional_fixtures = true
28
- config.infer_base_class_for_anonymous_controllers = false
51
+ # Limits the available syntax to the non-monkey patched syntax that is recommended.
52
+ # For more details, see:
53
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
54
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
55
+ # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
56
+ config.disable_monkey_patching!
29
57
 
30
- config.before(:suite) do
31
- DatabaseCleaner.strategy = :transaction
32
- DatabaseCleaner.clean_with(:truncation)
58
+ # Many RSpec users commonly either run the entire suite or an individual
59
+ # file, and it's useful to allow more verbose output when running an
60
+ # individual spec file.
61
+ if config.files_to_run.one?
62
+ # Use the documentation formatter for detailed output,
63
+ # unless a formatter has already been configured
64
+ # (e.g. via a command-line flag).
65
+ config.default_formatter = 'doc'
33
66
  end
34
67
 
35
- config.before(:each) do
36
- DatabaseCleaner.start
37
- end
68
+ # Print the 10 slowest examples and example groups at the
69
+ # end of the spec run, to help surface which specs are running
70
+ # particularly slow.
71
+ config.profile_examples = 10
38
72
 
39
- config.after(:each) do
40
- DatabaseCleaner.clean
41
- end
73
+ # Run specs in random order to surface order dependencies. If you find an
74
+ # order dependency and want to debug it, you can fix the order by providing
75
+ # the seed, which is printed after each run.
76
+ # --seed 1234
77
+ config.order = :random
78
+
79
+ # Seed global randomization in this process using the `--seed` CLI option.
80
+ # Setting this allows you to use `--seed` to deterministically reproduce
81
+ # test failures related to randomization by passing the same `--seed` value
82
+ # as the one that triggered the failure.
83
+ Kernel.srand config.seed
84
+ =end
42
85
  end
metadata CHANGED
@@ -1,43 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_media
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.beta1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Westlake Design
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-30 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rails
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '4.1'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '4.1'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: tb_core
29
15
  requirement: !ruby/object:Gem::Requirement
30
16
  requirements:
31
- - - ">="
17
+ - - "~>"
32
18
  - !ruby/object:Gem::Version
33
- version: 1.2.7
19
+ version: 1.3.0
34
20
  type: :runtime
35
21
  prerelease: false
36
22
  version_requirements: !ruby/object:Gem::Requirement
37
23
  requirements:
38
- - - ">="
24
+ - - "~>"
39
25
  - !ruby/object:Gem::Version
40
- version: 1.2.7
26
+ version: 1.3.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: paperclip
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,118 +52,76 @@ dependencies:
66
52
  - - ">="
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '='
74
- - !ruby/object:Gem::Version
75
- version: 2.8.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '='
81
- - !ruby/object:Gem::Version
82
- version: 2.8.0
83
55
  - !ruby/object:Gem::Dependency
84
56
  name: rspec-rails
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '='
88
- - !ruby/object:Gem::Version
89
- version: 2.8.1
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 2.8.1
97
- - !ruby/object:Gem::Dependency
98
- name: shoulda
99
57
  requirement: !ruby/object:Gem::Requirement
100
58
  requirements:
101
59
  - - "~>"
102
60
  - !ruby/object:Gem::Version
103
- version: 3.0.1
61
+ version: 3.1.0
104
62
  type: :development
105
63
  prerelease: false
106
64
  version_requirements: !ruby/object:Gem::Requirement
107
65
  requirements:
108
66
  - - "~>"
109
67
  - !ruby/object:Gem::Version
110
- version: 3.0.1
68
+ version: 3.1.0
111
69
  - !ruby/object:Gem::Dependency
112
- name: factory_girl
70
+ name: factory_girl_rails
113
71
  requirement: !ruby/object:Gem::Requirement
114
72
  requirements:
115
- - - '='
116
- - !ruby/object:Gem::Version
117
- version: 2.5.0
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '='
123
- - !ruby/object:Gem::Version
124
- version: 2.5.0
125
- - !ruby/object:Gem::Dependency
126
- name: mocha
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - '='
73
+ - - "~>"
130
74
  - !ruby/object:Gem::Version
131
- version: 0.10.3
75
+ version: 4.5.0
132
76
  type: :development
133
77
  prerelease: false
134
78
  version_requirements: !ruby/object:Gem::Requirement
135
79
  requirements:
136
- - - '='
80
+ - - "~>"
137
81
  - !ruby/object:Gem::Version
138
- version: 0.10.3
82
+ version: 4.5.0
139
83
  - !ruby/object:Gem::Dependency
140
84
  name: database_cleaner
141
85
  requirement: !ruby/object:Gem::Requirement
142
86
  requirements:
143
- - - '='
87
+ - - "~>"
144
88
  - !ruby/object:Gem::Version
145
- version: 1.0.0.RC1
89
+ version: 1.3.0
146
90
  type: :development
147
91
  prerelease: false
148
92
  version_requirements: !ruby/object:Gem::Requirement
149
93
  requirements:
150
- - - '='
94
+ - - "~>"
151
95
  - !ruby/object:Gem::Version
152
- version: 1.0.0.RC1
96
+ version: 1.3.0
153
97
  - !ruby/object:Gem::Dependency
154
98
  name: simplecov
155
99
  requirement: !ruby/object:Gem::Requirement
156
100
  requirements:
157
101
  - - "~>"
158
102
  - !ruby/object:Gem::Version
159
- version: 0.6.4
103
+ version: 0.9.1
160
104
  type: :development
161
105
  prerelease: false
162
106
  version_requirements: !ruby/object:Gem::Requirement
163
107
  requirements:
164
108
  - - "~>"
165
109
  - !ruby/object:Gem::Version
166
- version: 0.6.4
110
+ version: 0.9.1
167
111
  - !ruby/object:Gem::Dependency
168
112
  name: capybara
169
113
  requirement: !ruby/object:Gem::Requirement
170
114
  requirements:
171
115
  - - '='
172
116
  - !ruby/object:Gem::Version
173
- version: 2.0.1
117
+ version: 2.2.0
174
118
  type: :development
175
119
  prerelease: false
176
120
  version_requirements: !ruby/object:Gem::Requirement
177
121
  requirements:
178
122
  - - '='
179
123
  - !ruby/object:Gem::Version
180
- version: 2.0.1
124
+ version: 2.2.0
181
125
  - !ruby/object:Gem::Dependency
182
126
  name: jasmine
183
127
  requirement: !ruby/object:Gem::Requirement
@@ -259,7 +203,7 @@ files:
259
203
  - lib/spud_media/version.rb
260
204
  - lib/tasks/spud_media_tasks.rake
261
205
  - lib/tb_media.rb
262
- - spec/controllers/media_controller_spec.rb
206
+ - spec/controllers/admin/media_controller_spec.rb
263
207
  - spec/dummy/README.rdoc
264
208
  - spec/dummy/Rakefile
265
209
  - spec/dummy/app/assets/javascripts/application.js
@@ -308,6 +252,7 @@ files:
308
252
  - spec/dummy/public/system/spud_media/4/cropped/test_img1.jpg
309
253
  - spec/dummy/public/system/spud_media/4/original/test_img1.png
310
254
  - spec/dummy/public/system/spud_media/4/small/test_img1.png
255
+ - spec/dummy/public/system/spud_media/5/cropped/test_img1.jpg
311
256
  - spec/dummy/public/system/spud_media/5/original/test_img1.png
312
257
  - spec/dummy/public/system/spud_media/5/small/test_img1.png
313
258
  - spec/dummy/script/rails
@@ -317,6 +262,7 @@ files:
317
262
  - spec/javascripts/support/jasmine.yml
318
263
  - spec/javascripts/support/jasmine_helper.rb
319
264
  - spec/models/spud_media_spec.rb
265
+ - spec/rails_helper.rb
320
266
  - spec/spec_helper.rb
321
267
  - spec/support/authlogic_helper.rb
322
268
  homepage: http://bitbucket.org/westlakedesign/tb_media
@@ -333,17 +279,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
333
279
  version: '0'
334
280
  required_rubygems_version: !ruby/object:Gem::Requirement
335
281
  requirements:
336
- - - ">"
282
+ - - ">="
337
283
  - !ruby/object:Gem::Version
338
- version: 1.3.1
284
+ version: '0'
339
285
  requirements: []
340
286
  rubyforge_project:
341
- rubygems_version: 2.2.1
287
+ rubygems_version: 2.4.2
342
288
  signing_key:
343
289
  specification_version: 4
344
290
  summary: TB File upload/management module
345
291
  test_files:
346
- - spec/controllers/media_controller_spec.rb
292
+ - spec/controllers/admin/media_controller_spec.rb
347
293
  - spec/dummy/app/assets/javascripts/application.js
348
294
  - spec/dummy/app/assets/stylesheets/application.css
349
295
  - spec/dummy/app/controllers/application_controller.rb
@@ -390,6 +336,7 @@ test_files:
390
336
  - spec/dummy/public/system/spud_media/4/cropped/test_img1.jpg
391
337
  - spec/dummy/public/system/spud_media/4/original/test_img1.png
392
338
  - spec/dummy/public/system/spud_media/4/small/test_img1.png
339
+ - spec/dummy/public/system/spud_media/5/cropped/test_img1.jpg
393
340
  - spec/dummy/public/system/spud_media/5/original/test_img1.png
394
341
  - spec/dummy/public/system/spud_media/5/small/test_img1.png
395
342
  - spec/dummy/Rakefile
@@ -401,5 +348,6 @@ test_files:
401
348
  - spec/javascripts/support/jasmine.yml
402
349
  - spec/javascripts/support/jasmine_helper.rb
403
350
  - spec/models/spud_media_spec.rb
351
+ - spec/rails_helper.rb
404
352
  - spec/spec_helper.rb
405
353
  - spec/support/authlogic_helper.rb