inline_forms 6.0.7 → 6.2.2

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
- SHA256:
3
- metadata.gz: e7267f675ac24a67ee56986b7d2f85500b1f194ee15f395a87b076b4f5a7a7aa
4
- data.tar.gz: 8d7a638344ccbb689a0acee88b87c12a6121823cc23753ee8c02d943366ccc60
2
+ SHA1:
3
+ metadata.gz: 9e19b3d82e6de0df43442bb214a4a86584883559
4
+ data.tar.gz: 8a27cd31703bff9ed2ebd766993f5385871c7ebf
5
5
  SHA512:
6
- metadata.gz: 4e4cb6691bf8ce4eb74ea1b598fa6c83c5a7bbd115ae5f40a5f51b24ad82be7567f26fb36db7c61d41383b9d9c42b3bc141a571f90e5b3baabbfa762c749d269
7
- data.tar.gz: 426095cd3c2fb78a117e90a0743bbd8723f4e735249b8fd1af15ec221b10edb3e8fe923f26794e4e9aeef9323b8d727d2d1fd11c63986e99f6d1a588c2c6c231
6
+ metadata.gz: 76aac0acc9134eb2c01c56deb8f31126411ceaa3d7dd83d67aeafe65eb89c2252ecadc5188e21089acae582867b74e75df9ed79bf6755d9f6e43d88ff8b0f266
7
+ data.tar.gz: a83a88d9941cc3d4d9a8303289088a14ca1e9ced0b4e144d15ece3de6f33dc6a11587711a19c2b2726b053a74040061c9cee6d43ff459d4289ad9efc8fcd7a9e
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Ace Suares
1
+ Copyright (c) 2011 - 2021 Ace Suares
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -4,6 +4,7 @@
4
4
  //= require jquery.timepicker.js
5
5
  //= require foundation
6
6
  //= require jquery.remotipart
7
+ //= require autocomplete-rails
7
8
 
8
9
  $(function(){ $(document).foundation(); });
9
10
  // initialize datepickers
@@ -2,7 +2,7 @@
2
2
  class InlineFormsApplicationController < ActionController::Base
3
3
  protect_from_forgery
4
4
  layout 'devise' if :devise_controller?
5
-
5
+
6
6
  # limit available locales by setting this. Override in applicaton_controller.
7
7
  I18n.available_locales = [ :en, :nl, :pp ]
8
8
 
@@ -10,7 +10,7 @@ class InlineFormsApplicationController < ActionController::Base
10
10
  def set_locale
11
11
  I18n.locale = extract_locale_from_subdomain || I18n.default_locale
12
12
  end
13
-
13
+
14
14
  # Get locale code from request subdomain (like http://it.application.local:3000)
15
15
  def extract_locale_from_subdomain
16
16
  locale = request.subdomains.first
@@ -95,7 +95,7 @@ class InlineFormsController < ApplicationController
95
95
  @update_span = params[:update]
96
96
  attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list
97
97
  attributes.each do | attribute, name, form_element |
98
- send("#{form_element.to_s}_update", @object, attribute) unless form_element == :tree || form_element == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute))
98
+ send("#{form_element.to_s}_update", @object, attribute) unless form_element == :tree || form_element == :associated || (cancan_enabled? && cannot?(:read, @object, attribute))
99
99
  end
100
100
  @parent_class = params[:parent_class]
101
101
  @parent_id = params[:parent_id]
@@ -83,7 +83,7 @@ module InlineFormsHelper
83
83
  :title => t('inline_forms.view.add_new', :model => model.model_name.human )
84
84
  )
85
85
  if cancan_enabled?
86
- if can? :create, model.to_s.pluralize.underscore.to_sym
86
+ if can? :create, model
87
87
  if parent_class.nil?
88
88
  raw out
89
89
  else
@@ -97,17 +97,19 @@ module InlineFormsHelper
97
97
 
98
98
  # link to versions list
99
99
  def link_to_versions_list(path_to_versions_list, object, update_span, html_class = 'button new_button')
100
- out = (link_to "<i class='fi-list'></i>".html_safe,
101
- send(path_to_versions_list,
102
- object,
103
- :update => update_span,
104
- ),
105
- :remote => true,
106
- :class => html_class,
107
- :title => t('inline_forms.view.list_versions')
108
- )
109
- if can? :list_versions, object.class.name.pluralize.underscore.to_sym
110
- raw out
100
+ if can? :list_versions, object
101
+ if defined?(PaperTrail) && object.respond_to?(:versions)
102
+ out = (link_to "<i class='fi-list'></i>".html_safe,
103
+ send(path_to_versions_list,
104
+ object,
105
+ :update => update_span,
106
+ ),
107
+ :remote => true,
108
+ :class => html_class,
109
+ :title => t('inline_forms.view.list_versions')
110
+ )
111
+ raw out
112
+ end
111
113
  end
112
114
  end
113
115
 
@@ -130,7 +132,8 @@ module InlineFormsHelper
130
132
  spaces = attribute_value.length > 40 ? 0 : 40 - attribute_value.length
131
133
  value = h(attribute_value) + ("&nbsp;" * spaces).html_safe
132
134
  css_class_id = "#{object.class.to_s.underscore}_#{object.id}_#{attribute}"
133
- if cancan_disabled? || ( can? :update, object, attribute )
135
+ if (cancan_disabled? rescue true) || ( can? :update, object, attribute )
136
+ # some problem with concerns makes this function not available when called direct. FIXME
134
137
  link_to value,
135
138
  send( 'edit_' + object.class.to_s.underscore + '_path',
136
139
  object,
@@ -22,7 +22,7 @@
22
22
  <% MODEL_TABS.each do |m| %>
23
23
  <% model = m.singularize.camelcase.constantize rescue nil %>
24
24
  <% unless model.nil? || model.not_accessible_through_html? %>
25
- <% if can? :update, m.to_sym %>
25
+ <% if can? :update, model %>
26
26
  <li>
27
27
  <%= link_to model.model_name.human, '/' + m %>
28
28
  </li>
@@ -23,7 +23,7 @@
23
23
  :multipart => true, :remote => true, :class => "edit_form" do -%>
24
24
  <% attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list -%>
25
25
  <% attributes.each do | attribute, name, form_element | -%>
26
- <% unless form_element.to_sym == :associated || form_element.to_sym == :tree || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute)) -%>
26
+ <% unless form_element.to_sym == :associated || form_element.to_sym == :tree || (cancan_enabled? && cannot?(:read, @object, attribute)) -%>
27
27
  <% css_class_id = "attribute_#{attribute}_#{@object.id}" -%>
28
28
  <% if form_element && form_element.to_sym == :header %>
29
29
  <div class="row form_element_header" >
@@ -115,7 +115,7 @@
115
115
  <% end %>
116
116
  <% end %>
117
117
  <% end %>
118
- <% if can? :list_versions, @object.class.name.pluralize.underscore.to_sym %>
118
+ <% if can? :list_versions, @object %>
119
119
  <% css_class_id = "#{@object.class.name.underscore}_#{@object.id}_versions" -%>
120
120
  <div id="<%= css_class_id -%>">
121
121
  <%= render 'versions' %>
@@ -44,11 +44,14 @@
44
44
  <div class="small-1 column">
45
45
  <%= version.event -%>
46
46
  </div>
47
+ <div class="small-2 column">
48
+ <%= version.created_at -%>
49
+ </div>
47
50
  <div class="small-2 column">
48
51
  <%= version_modified_by version.whodunnit -%>
49
52
  </div>
50
- <div class="small-8 column">
51
- <% if version.changeset.empty? %>
53
+ <div class="small-6 column">
54
+ <% if version.changeset.nil? || version.changeset.empty? %>
52
55
  <em>empty</em>
53
56
  <% else %>
54
57
  <% version.changeset.each do |attribute, value| %>
@@ -1,57 +1,55 @@
1
1
  GENERATOR_PATH = File.dirname(File.expand_path(__FILE__)) + '/../'
2
2
 
3
- create_file 'Gemfile', "# created by inline_forms #{ENV['inline_forms_version']} on {Date.today}\n"
3
+ create_file 'Gemfile', "# created by inline_forms #{ENV['inline_forms_version']} on #{Date.today}\n"
4
4
 
5
5
  add_source 'https://rubygems.org'
6
6
 
7
- gem 'cancancan', '~> 2.0'
7
+ gem 'cancancan'
8
8
  gem 'carrierwave'
9
- gem 'ckeditor', git: 'https://github.com/galetahub/ckeditor'
10
- #gem 'bootsnap', require: false
9
+ gem 'ckeditor', github: 'galetahub/ckeditor'
11
10
  gem 'coffee-rails'
12
- #gem 'compass-rails'
11
+ gem 'devise-i18n', :git => 'https://github.com/acesuares/devise-i18n.git'
13
12
  gem 'devise'
14
13
  gem 'foundation-icons-sass-rails'
15
14
  gem 'foundation-rails', '~> 5.5'
16
- gem 'i18n-active_record', git: 'https://github.com/acesuares/i18n-active_record.git'
17
- gem 'inline_forms', '>=5'
15
+ gem 'i18n-active_record', :git => 'https://github.com/acesuares/i18n-active_record.git'
16
+ gem 'inline_forms', '~> 6.2'
18
17
  gem 'jquery-rails'
19
18
  gem 'jquery-timepicker-rails'
20
19
  gem 'jquery-ui-sass-rails'
21
20
  gem 'mini_magick'
22
21
  gem 'mysql2'
23
- gem 'paper_trail'
24
- gem 'rails-i18n'
25
- gem 'rails', '~> 5.2.1'
22
+ gem 'paper_trail', git: 'https://github.com/acesuares/paper_trail.git'
23
+ gem 'rails-i18n', :git => 'https://github.com/svenfuchs/rails-i18n.git' # since https://github.com/svenfuchs/rails-i18n/pull/794 we don't have to maintain 'https://github.com/acesuares/rails-i18n.git' anymore!
24
+ gem 'rails-jquery-autocomplete'
25
+ gem 'rails', '6.1.3.1'
26
26
  gem 'rake'
27
27
  gem 'remotipart', '~> 1.0'
28
28
  gem 'rvm'
29
29
  gem 'sass-rails'
30
- gem 'tabs_on_rails'
31
- gem 'therubyracer'
32
- gem 'uglifier'
33
- gem 'figaro'
30
+ gem 'tabs_on_rails', :git => 'https://github.com/acesuares/tabs_on_rails.git', :branch => 'update_remote_before_action'
34
31
  gem 'unicorn'
35
32
  gem 'validation_hints'
36
33
  gem 'will_paginate' #, git: 'https://github.com/acesuares/will_paginate.git'
37
- # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
38
- gem 'turbolinks', '~> 5'
39
34
 
40
35
  gem_group :development do
41
- gem 'bundler'
36
+ gem 'capistrano-bundler', require: false
37
+ gem 'capistrano-rails', require: false
38
+ gem 'capistrano', require: false
39
+ gem 'capistrano3-unicorn'
42
40
  gem 'listen'
43
- gem 'rspec-rails'
44
- gem 'rspec'
45
- gem 'seed_dump', git: 'https://github.com/acesuares/seed_dump.git'
46
- gem 'shoulda'
41
+ gem 'rvm-capistrano', :require => false
42
+ gem 'rvm1-capistrano3', require: false
43
+ gem 'seed_dump', '~> 0.5.3'
47
44
  gem 'sqlite3'
48
45
  gem 'switch_user'
46
+ gem 'thin'
49
47
  gem 'yaml_db'
50
- gem 'capistrano', '~> 3.6', require: false
51
- gem 'capistrano-rails', '~> 1.3', require: false
52
- gem 'capistrano-bundler', '~> 1.3', require: false
53
- gem 'rvm1-capistrano3', require: false
54
- gem "capistrano3-unicorn"
48
+ end
49
+
50
+ gem_group :production do
51
+ gem 'mini_racer'
52
+ gem 'uglifier'
55
53
  end
56
54
 
57
55
  say "- Running bundle..."
@@ -73,21 +71,55 @@ else
73
71
  create_file "config/database.yml", <<-END_DATABASEYML.strip_heredoc
74
72
  development:
75
73
  adapter: mysql2
76
- database: <%= ENV["DATABASE_NAME"] %>
77
- username: <%= ENV["DATABASE_USER"] %>
78
- password: <%= ENV["DATABASE_PASSWORD"] %>
74
+ database: <%= Rails.application.credentials.development[:database] %>
75
+ username: <%= Rails.application.credentials.development[:username] %>
76
+ password: <%= Rails.application.credentials.development[:password] %>
79
77
  END_DATABASEYML
78
+
79
+ say "- Setting development database in credentials"
80
+ create_file "temp_development_database_credentials", <<-END_DEV_DB_CRED.strip_heredoc
81
+
82
+ development:
83
+ database: #{app_name.downcase}_dev
84
+ username: #{app_name.downcase}_dev_user
85
+ password: #{app_name.downcase}_dev_password
86
+
87
+ END_DEV_DB_CRED
88
+
89
+ run "EDITOR='cat temp_development_database_credentials >> ' rails credentials:edit"
90
+
91
+ remove_file 'temp_development_database_credentials'
92
+
93
+ say "\n *** Please make sure to create a mysql development database with the following credentials:
94
+ database: #{app_name.downcase}_dev
95
+ username: #{app_name.downcase}_dev_user
96
+ password: #{app_name.downcase}_dev_password
97
+
98
+ or use 'rails credentials:edit' to change these values.\n\n", :red
99
+
80
100
  end
81
101
  append_file "config/database.yml", <<-END_DATABASEYML.strip_heredoc
82
102
  production:
83
103
  adapter: mysql2
84
- database: <%= ENV["DATABASE_NAME"] %>
85
- username: <%= ENV["DATABASE_USER"] %>
86
- password: <%= ENV["DATABASE_PASSWORD"] %>
104
+ database: <%= Rails.application.credentials.production[:database] %>
105
+ username: <%= Rails.application.credentials.production[:username] %>
106
+ password: <%= Rails.application.credentials.production[:password] %>
87
107
  END_DATABASEYML
88
108
 
89
- say "- Add rails 5.2 defaults to application.rb..."
90
- gsub_file "config/application.rb", /6\.0/, '5.2'
109
+ say "Setting production database in credentials"
110
+ create_file "temp_production_database_credentials", <<-END_PROD_DB_CRED.strip_heredoc
111
+ production:
112
+ database: #{app_name.downcase}_prod
113
+ username: #{app_name.downcase}_prod_user
114
+ password:
115
+
116
+ END_PROD_DB_CRED
117
+
118
+ run "EDITOR='cat temp_production_database_credentials >> ' rails credentials:edit"
119
+
120
+ remove_file 'temp_production_database_credentials'
121
+
122
+ say "\n *** Please make sure to create a mysql production database and use 'rails credentials:edit' to set the password.\n\n", :red
91
123
 
92
124
  say "- Devise install..."
93
125
  run "bundle exec rails g devise:install"
@@ -291,15 +323,8 @@ copy_file File.join(GENERATOR_PATH, 'lib/generators/templates/application_record
291
323
  say "- Install ckeditor..."
292
324
  generate "ckeditor:install --orm=active_record --backend=carrierwave"
293
325
 
294
- say "- Add ckeditor autoload_paths to application.rb..."
295
- application "config.autoload_paths += %W(\#{config.root}/app/models/ckeditor)"
296
-
297
- # see https://github.com/galetahub/ckeditor/issues/579
298
- #say "- Set languages for ckeditor to ['en', 'nl'] in config/initializers/ckeditor.rb..."
299
- #insert_into_file "config/initializers/ckeditor.rb", " config.assets_languages = ['en', 'nl']\n", :after => "config.assets_languages = ['en', 'uk']\n"
300
-
301
326
  say "- Paper_trail install..."
302
- generate "paper_trail:install --with-changes"
327
+ generate "paper_trail:install --with-changes --with-mysql"
303
328
 
304
329
  # Create Translations
305
330
  say "- Generate models and tables and views for translations..." # TODO Translations need to be done in inline_forms, and then generate a yml file, perhaps
@@ -360,23 +385,34 @@ create_file "app/helpers/application_helper.rb", <<-END_APPHELPER.strip_heredoc
360
385
  end
361
386
  END_APPHELPER
362
387
 
388
+ say "- Creating inline_forms initializer"
389
+ create_file "config/initializers/inline_forms.rb", <<-END_INITIALIZER.strip_heredoc
390
+ Rails.application.reloader.to_prepare do
391
+ MODEL_TABS = %w()
392
+ end
393
+ END_INITIALIZER
394
+
363
395
  say "- Recreating ApplicationController to add devise, cancan, I18n stuff..."
364
396
  remove_file "app/controllers/application_controller.rb" # the one that 'rails new' created
365
397
  create_file "app/controllers/application_controller.rb", <<-END_APPCONTROLLER.strip_heredoc
366
398
  class ApplicationController < InlineFormsApplicationController
367
399
  protect_from_forgery
368
400
 
369
- # Comment next line if you don't want Devise authentication
370
- before_action :authenticate_user!
401
+ # add whodunnit
402
+ before_action :set_paper_trail_whodunnit
371
403
 
372
- # Comment next 6 lines if you do not want CanCan authorization
404
+ # Comment next lines if you don't want Devise authentication
405
+ before_action :authenticate_user!
373
406
  check_authorization unless: :devise_controller?
374
407
 
375
408
  rescue_from CanCan::AccessDenied do |exception|
376
- redirect_to root_path, alert: exception.message
409
+ respond_to do |format|
410
+ format.json { head :forbidden, content_type: 'text/html' }
411
+ format.html { redirect_to main_app.root_url, notice: exception.message }
412
+ format.js { head :forbidden, content_type: 'text/html' }
413
+ end
377
414
  end
378
-
379
- ActionView::CompiledTemplates::MODEL_TABS = %w()
415
+ # Comment previous lines if you don't want Devise authentication
380
416
 
381
417
  # Uncomment next line if you want I18n (based on subdomain)
382
418
  # before_action :set_locale
@@ -422,77 +458,6 @@ create_file "app/models/ability.rb", <<-END_ABILITY.strip_heredoc
422
458
  end
423
459
  END_ABILITY
424
460
 
425
- say "- Generating test files", :green
426
-
427
- create_file "spec/spec_helper.rb", <<-END_TEST_HELPER.strip_heredoc
428
- # This file is copied to spec/ when you run 'rails generate rspec:install'
429
- ENV["RAILS_ENV"] ||= 'development' # this need to be changed to test ???
430
- require File.expand_path("../../config/environment", __FILE__)
431
- require 'capybara/rspec'
432
- require 'rspec/rails'
433
- require 'rspec/autorun'
434
- require 'carrierwave/test/matchers'
435
-
436
-
437
- # Requires supporting ruby files with custom matchers and macros, etc,
438
- # in spec/support/ and its subdirectories.
439
- Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
440
-
441
- RSpec.configure do |config|
442
- config.include FactoryGirl::Syntax::Methods
443
- # ## Mock Framework
444
- #
445
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
446
- #
447
- # config.mock_with :mocha
448
- # config.mock_with :flexmock
449
- # config.mock_with :rr
450
-
451
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
452
- config.fixture_path = Rails.root + "/spec/fixtures"
453
-
454
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
455
- # examples within a transaction, remove the following line or assign false
456
- # instead of true.
457
- config.use_transactional_fixtures = true
458
-
459
- # If true, the base class of anonymous controllers will be inferred
460
- # automatically. This will be the default behavior in future versions of
461
- # rspec-rails.
462
- config.infer_base_class_for_anonymous_controllers = false
463
-
464
- # Run specs in random order to surface order dependencies. If you find an
465
- # order dependency and want to debug it, you can fix the order by providing
466
- # the seed, which is printed after each run.
467
- # --seed 1234
468
- config.order = "random"
469
- end
470
- END_TEST_HELPER
471
-
472
- say 'copy test image into rspec folder'
473
- copy_file File.join(GENERATOR_PATH,'lib/otherstuff/fixtures/rails.png'), "spec/fixtures/images/rails.png"
474
- say '- Creating factory_girl file'
475
- create_file "spec/factories/inline_forms.rb", <<-END_FACTORY_GIRL.strip_heredoc
476
- FactoryGirl.define do
477
- factory :apartment do
478
- name "Luxe House in Bandabou 147A" #string
479
- title "A dream house in a dream place" # string
480
- description "A beatiful House at the edge of the <strong>sea</strong>" #text
481
- end
482
- factory :large_text do
483
- name "Luxe House in Bandabou 147A" #string
484
- title "A dream house in a dream place" # string
485
- description "A beatiful House at the edge of the <strong>sea</strong>" #text
486
- end
487
- end
488
- END_FACTORY_GIRL
489
- remove_file 'spec/factories/users.rb'
490
- remove_file 'spec/models/user_spec.rb'
491
-
492
- # precompile devise.css
493
- say "- Precompile devise.css in environments/production.rb... (Since Rails 5 in config/initializers/assets.rb !)"
494
- append_file "config/initializers/assets.rb", " Rails.application.config.assets.precompile += %w( inline_forms_devise.css )\n"
495
-
496
461
  # devise mailer stuff
497
462
  say "- Injecting devise mailer stuff in environments/production.rb..."
498
463
  # strip_heredoc_with_indent(2) became strip_heredoc(2), but only in rails 4... :-(
@@ -539,73 +504,27 @@ copy_file File.join(GENERATOR_PATH,'lib/generators/templates/capistrano/Capfile'
539
504
  say "- Unicorn Config..."
540
505
  copy_file File.join(GENERATOR_PATH,'lib/generators/templates/unicorn/production.rb'), "config/unicorn/production.rb"
541
506
 
542
-
543
507
  # Git
544
- say "- Initializing git..."
545
- run 'git init'
546
-
547
- insert_into_file ".gitignore", <<-GITIGNORE.strip_heredoc, :after => "/tmp\n"
548
- # remotipart uploads
549
- public/uploads
550
- # Figaro secrets
551
- config/application.yml
552
- GITIGNORE
553
-
554
- say "- Installing Figaro..."
555
- run 'bundle exec figaro install'
556
- remove_file "config/application.yml"
557
- copy_file File.join(GENERATOR_PATH,'lib/generators/templates/application.yml.blank'), "config/application.yml"
558
- copy_file File.join(GENERATOR_PATH,'lib/generators/templates/application.yml.blank'), "config/application.yml.blank"
559
-
560
- say "- Installing config/secrets.yml..."
561
- remove_file "config/secrets.yml"
562
- create_file "config/secrets.yml", <<-END_SECRETS_YML.strip_heredoc
563
- development:
564
- secret_key_base: #{SecureRandom.hex(64)}
565
-
566
- test:
567
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
568
-
569
- production:
570
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
571
- END_SECRETS_YML
508
+ say "- adding and committing to git..."
572
509
 
573
- run 'git add .'
574
- run 'git commit -a -m " * Initial"'
510
+ git add: "."
511
+ git commit: " -a -m 'Initial Commit'"
575
512
 
576
513
  # example
577
514
  if ENV['install_example'] == 'true'
578
515
  say "\nInstalling example application..."
579
- run 'bundle exec rails g inline_forms Photo name:string caption:string image:image_field description:ckeditor apartment:belongs_to _presentation:\'#{name}\'' # FIXME temporary changed because ckeditor is playing dirty
516
+ run 'bundle exec rails g inline_forms Photo name:string caption:string image:image_field description:ckeditor apartment:belongs_to _presentation:\'#{name}\''
580
517
  run 'bundle exec rails generate uploader Image'
581
- run 'bundle exec rails g inline_forms Apartment name:string title:string description:ckeditor photos:has_many photos:associated _enabled:yes _presentation:\'#{name}\'' # FIXME temporary changed because ckeditor is playing dirty
518
+ run 'bundle exec rails g inline_forms Apartment name:string title:string description:ckeditor photos:has_many photos:associated _enabled:yes _presentation:\'#{name}\''
582
519
  run 'bundle exec rake db:migrate'
583
- say '-Adding example test'
584
- create_file "spec/models/#{app_name}_example.rb", <<-END_EXAMPLE_TEST.strip_heredoc
585
- require "spec_helper"
586
- describe Apartment do
587
- it "insert an appartment and retrieve it" do
588
- appartment_data = create(:apartment)
589
- first = Apartment.first.id
590
- expect(Apartment.first.id).to eq(first)
591
- end
592
- end
593
- END_EXAMPLE_TEST
594
520
 
595
- #run "rspec" if ENV['runtest']
596
521
  remove_file 'public/index.html'
522
+
597
523
  route "root :to => 'apartments#index'"
598
524
 
599
- # done!
600
525
  say "\nDone! Now point your browser to http://localhost:3000", :yellow
601
526
  say "\nPress ctlr-C to quit...", :yellow
602
527
  run 'bundle exec rails s'
603
- else
604
- # run tests
605
- #run "rspec" if ENV['runtest']
606
- say "- Don't forget: add your secret key base in config/application.yml \n"
607
528
  end
608
529
  # done!
609
530
  say "\nDone! Now make your tables with 'bundle exec rails g inline_forms ...", :yellow
610
-
611
- #say "- Don't forget: edit .rvmrc, config/{routes.rb, deploy.rb}, .git/config, delete \n"
data/inline_forms.gemspec CHANGED
@@ -23,12 +23,7 @@ Gem::Specification.new do |s|
23
23
  s.add_dependency('rvm')
24
24
  s.add_dependency('thor')
25
25
  s.add_dependency('validation_hints')
26
- s.add_dependency('rails', '>= 6.0')
26
+ s.add_dependency('rails', '6.1.3.1')
27
27
  s.add_dependency('rails-i18n')
28
28
 
29
- s.add_development_dependency(%q<rspec-rails>)
30
- s.add_development_dependency(%q<shoulda>)
31
- s.add_development_dependency(%q<bundler>)
32
- s.add_development_dependency(%q<jeweler>)
33
-
34
29
  end
@@ -1,8 +1,3 @@
1
- # Load ENV vars via Figaro
2
- require 'figaro'
3
- Figaro.application = Figaro::Application.new(environment: 'production', path: File.expand_path('../config/application.yml', __FILE__))
4
- Figaro.load
5
-
6
1
  # Load DSL and set up stages
7
2
  require "capistrano/setup"
8
3
 
@@ -1,4 +1,4 @@
1
- class InlineFormsCreate<%= table_name.camelize %> < ActiveRecord::Migration[5.0]
1
+ class InlineFormsCreate<%= table_name.camelize %> < ActiveRecord::Migration[6.1]
2
2
 
3
3
  def self.up
4
4
  create_table :<%= table_name + @primary_key_option %> do |t|
data/lib/inline_forms.rb CHANGED
@@ -139,7 +139,8 @@ module InlineForms
139
139
  class Engine < Rails::Engine
140
140
 
141
141
  initializer "inline_forms.assets.precompile" do |app|
142
- app.config.assets.precompile += %w( inline_forms/inline_forms.scss
142
+ app.config.assets.precompile += %w(
143
+ inline_forms/inline_forms.css
143
144
  inline_forms/devise.css
144
145
  inline_forms/inline_forms.js
145
146
  inline_forms/ckeditor/config.js
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "6.0.7"
3
+ VERSION = "6.2.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.7
4
+ version: 6.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
@@ -10,132 +10,76 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-06-30 00:00:00.000000000 Z
13
+ date: 2021-04-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rvm
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ">="
19
+ - - '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ">="
26
+ - - '>='
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: thor
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ">="
33
+ - - '>='
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ">="
40
+ - - '>='
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: validation_hints
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
47
+ - - '>='
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ">="
54
+ - - '>='
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: rails
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ">="
61
+ - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: '6.0'
63
+ version: 6.1.3.1
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
- - - ">="
68
+ - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: '6.0'
70
+ version: 6.1.3.1
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rails-i18n
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ">="
75
+ - - '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: '0'
85
- - !ruby/object:Gem::Dependency
86
- name: rspec-rails
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: '0'
92
- type: :development
93
- prerelease: false
94
- version_requirements: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- version: '0'
99
- - !ruby/object:Gem::Dependency
100
- name: shoulda
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: '0'
106
- type: :development
107
- prerelease: false
108
- version_requirements: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: '0'
113
- - !ruby/object:Gem::Dependency
114
- name: bundler
115
- requirement: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - ">="
118
- - !ruby/object:Gem::Version
119
- version: '0'
120
- type: :development
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: '0'
127
- - !ruby/object:Gem::Dependency
128
- name: jeweler
129
- requirement: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - ">="
132
- - !ruby/object:Gem::Version
133
- version: '0'
134
- type: :development
135
- prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ">="
82
+ - - '>='
139
83
  - !ruby/object:Gem::Version
140
84
  version: '0'
141
85
  description: Inline Forms aims to ease the setup of forms that provide inline editing.
@@ -149,9 +93,8 @@ executables:
149
93
  extensions: []
150
94
  extra_rdoc_files: []
151
95
  files:
152
- - ".document"
153
- - ".gitignore"
154
- - ".vscode/settings.json"
96
+ - .document
97
+ - .gitignore
155
98
  - Gemfile
156
99
  - LICENSE.txt
157
100
  - README.rdoc
@@ -265,8 +208,6 @@ files:
265
208
  - lib/generators/assets/stylesheets/inline_forms_devise.css
266
209
  - lib/generators/inline_forms_generator.rb
267
210
  - lib/generators/templates/_inline_forms_tabs.html.erb
268
- - lib/generators/templates/abstract_mysql2_adapter.rb
269
- - lib/generators/templates/application.yml.blank
270
211
  - lib/generators/templates/application_record.rb
271
212
  - lib/generators/templates/capistrano/Capfile
272
213
  - lib/generators/templates/capistrano/deploy.rb
@@ -274,7 +215,6 @@ files:
274
215
  - lib/generators/templates/controller.erb
275
216
  - lib/generators/templates/migration.erb
276
217
  - lib/generators/templates/model.erb
277
- - lib/generators/templates/paper_trail.rb
278
218
  - lib/generators/templates/test.erb
279
219
  - lib/generators/templates/unicorn/production.rb
280
220
  - lib/inline_forms.rb
@@ -283,9 +223,6 @@ files:
283
223
  - lib/locales/inline_forms.nl.yml
284
224
  - lib/otherstuff/20120310065554_inline_forms_create_view_for_translations.rb
285
225
  - lib/otherstuff/add_roles.sql
286
- - lib/otherstuff/bump
287
- - lib/otherstuff/diffie
288
- - lib/otherstuff/fixtures/rails.png
289
226
  - lib/otherstuff/mkiftrans
290
227
  - lib/otherstuff/mkrole
291
228
  - lib/otherstuff/roles_users.sql
@@ -300,16 +237,17 @@ require_paths:
300
237
  - lib
301
238
  required_ruby_version: !ruby/object:Gem::Requirement
302
239
  requirements:
303
- - - ">="
240
+ - - '>='
304
241
  - !ruby/object:Gem::Version
305
242
  version: '0'
306
243
  required_rubygems_version: !ruby/object:Gem::Requirement
307
244
  requirements:
308
- - - ">="
245
+ - - '>='
309
246
  - !ruby/object:Gem::Version
310
247
  version: '0'
311
248
  requirements: []
312
- rubygems_version: 3.0.1
249
+ rubyforge_project: inline_forms
250
+ rubygems_version: 2.6.14
313
251
  signing_key:
314
252
  specification_version: 4
315
253
  summary: Inline editing of forms.
@@ -1,3 +0,0 @@
1
- class ActiveRecord::ConnectionAdapters::Mysql2Adapter
2
- NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
3
- end
@@ -1,59 +0,0 @@
1
- DEVISE_SECRET_KEY:
2
- SECRET_TOKEN:
3
-
4
- DEPLOY_USER:
5
- DEPLOY_HOST:
6
- DEPLOY_APPLICATION:
7
- DEPLOY_REPO_URL:
8
- DEPLOY_DIRECTORY:
9
-
10
- development:
11
- ACTION_MAILER_SMTP_SETTINGS_ADDRESS:
12
- ACTION_MAILER_SMTP_SETTINGS_PASSWORD:
13
- ACTION_MAILER_SMTP_SETTINGS_USERNAME:
14
-
15
- DATABASE_NAME:
16
- DATABASE_USER:
17
- DATABASE_PASSWORD:
18
-
19
- FACEBOOK_APP_ID:
20
- FACEBOOK_APP_SECRET:
21
-
22
- GITHUB_CLIENT_ID:
23
- GITHUB_CLIENT_SECRET:
24
-
25
- SECRET_KEY_BASE:
26
-
27
- production:
28
- ACTION_MAILER_SMTP_SETTINGS_ADDRESS:
29
- ACTION_MAILER_SMTP_SETTINGS_PASSWORD:
30
- ACTION_MAILER_SMTP_SETTINGS_USERNAME:
31
-
32
- DATABASE_NAME:
33
- DATABASE_USER:
34
- DATABASE_PASSWORD:
35
-
36
- FACEBOOK_APP_ID:
37
- FACEBOOK_APP_SECRET:
38
-
39
- GITHUB_CLIENT_ID:
40
- GITHUB_CLIENT_SECRET:
41
-
42
- SECRET_KEY_BASE:
43
-
44
- test:
45
- ACTION_MAILER_SMTP_SETTINGS_ADDRESS:
46
- ACTION_MAILER_SMTP_SETTINGS_PASSWORD:
47
- ACTION_MAILER_SMTP_SETTINGS_USERNAME:
48
-
49
- DATABASE_NAME:
50
- DATABASE_USER:
51
- DATABASE_PASSWORD:
52
-
53
- FACEBOOK_APP_ID:
54
- FACEBOOK_APP_SECRET:
55
-
56
- GITHUB_CLIENT_ID:
57
- GITHUB_CLIENT_SECRET:
58
-
59
- SECRET_KEY_BASE:
@@ -1,7 +0,0 @@
1
- PaperTrail.config.track_associations = false
2
-
3
- PaperTrail::Version.class_eval do
4
- def author
5
- User.find(whodunnit) if whodunnit
6
- end
7
- end
data/lib/otherstuff/bump DELETED
@@ -1,13 +0,0 @@
1
- rule /^version:bump:.*/ do |t|
2
- sh "git status | grep 'nothing to commit'" # ensure we are not dirty
3
- index = ['major', 'minor','patch'].index(t.name.split(':').last)
4
- file = 'lib/GEM_NAME/version.rb'
5
-
6
- version_file = File.read(file)
7
- old_version, *version_parts = version_file.match(/(\d+)\.(\d+)\.(\d+)/).to_a
8
- version_parts[index] = version_parts[index].to_i + 1
9
- new_version = version_parts * '.'
10
- File.open(file,'w'){|f| f.write(version_file.sub(old_version, new_version)) }
11
-
12
- sh "bundle && git add #{file} Gemfile.lock && git commit -m 'bump version to #{new_version}'"
13
- end
@@ -1,2 +0,0 @@
1
- diff -ru /var/lib/gems/1.8/gems/inline_forms-0.9.16 inline_forms|grep ^diff -ru|sed "s/ inline_/ > inline_/"|sed "s/^diff -ru/cat/" > mkup
2
-
Binary file