Git Product home page Git Product logo

refinerycms-settings's Introduction

Refinery Framework

This is a little project to see if we can write a tidy underlying framework.

refinerycms-settings's People

Contributors

awagener avatar bricesanchez avatar coryschires avatar davidbennettpio avatar gwagener avatar jokklan avatar keram avatar mingliangfeng avatar parndt avatar pronix avatar robyurkowski avatar simi avatar ugisozols avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

refinerycms-settings's Issues

Name cannot be modified?

The name of the setting cannot be modified?

This is really not good; Settings is supposed to be used by customers, they don't understand the current title extracted from the configuration key.

What I mean is we need a title property which can be modified for settings.

rails g refinery:settings fails with missing Refinery::Application constant

Hi!

After adding refinerycms-settings to the Gemfile and running bundle install when I try to run rails generate refinery:settings it fails with:

kovacs-davids-macbook:toplamax_web kovacsd$ rails generate refinery:settings
Faraday: you may want to install system_timer for reliable timeouts
/Library/Ruby/Gems/1.8/gems/refinerycms-settings-1.0.5/config/routes.rb:1: uninitialized constant Refinery::Application (NameError)
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `each'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:40:in `load_paths'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/routes_reloader.rb:16:in `reload!'
    from /Users/kovacsd/.bundler/ruby/1.8/refinerycms-06cfc2142a62/core/lib/refinery/core/engine.rb:129
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `call'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
    from /Library/Ruby/Gems/1.8/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application/finisher.rb:59
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `instance_exec'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:30:in `run'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:55:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `each'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/initializable.rb:54:in `run_initializers'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application.rb:136:in `initialize!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `send'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/kovacsd/devel/toplamax_web/config/environment.rb:5
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/application.rb:103:in `require_environment!'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.6/lib/rails/commands.rb:25
    from script/rails:6:in `require'
    from script/rails:6

Thanks

Adding Help Text and Removing Delete Option

I am pretty new to Ruby and may just be missing something very simple, but would definitely appreciate the help.
I am having an issue adding help text and removing the delete option. I noticed these nifty possibilities on the demo site. Looking at the setting view file I can see the unless statement for the help-info icon (Line 17). The delete icon has a method that references destroyable (Line 15) but I'm still getting output where the demo site is not.

I wanted to make it impossible to delete the Site Name (site_name) setting.

I first found everywhere the core site name setting was used:

:site_name => Refinery::Core.site_name

and changed it to this:

:site_name => ::Refinery::Setting.get(:site_name)

Then I edited /config/initializers/refinery/settings.rb:

config.find_or_set(:site_name, ::Refinery::Core.site_name, { :destroyable => false })

Along with that failure, all I can deduce about setting help text is the setting_field method from the settings_helper.rb (Line 16)

whitespace is being stripped

2.0.2 is stripping whitespace from settings, 2.0.1 seems fine.

Also having trouble with yaml crashes in 2.0.2, not sure if it's related.

If you need an example let me know.

acts_as_indexed should be gem dependency?

Hi Philip,

My gemfile is as follows:

# Refinery CMS
gem 'refinerycms', '~> 2.0.3'
gem "refinerycms-settings", "~> 2.0.1"

But I'm getting an 'undefined method' error like so when using ::Refinery::Setting...

undefined method `acts_as_indexed' for #<Class:0x4542b88>

Adding 'acts_as_indexed' to the gemfile works, but shouldn't that be a dependency on this gem then?

Thanks :-)

get not returning array object

created setting with:

 :Refinery::Setting.find_or_set( :gardenia_parts_sidebar, %w(side_body recent_posts recent_news widgets ) )

viewed and edited once in admin dashboard; shows up as:

 ---
 - side_body
 - recent_posts
 - recent_news
 - widgets

but when accessed programmatically (say, in console):

 sidelist = ::Refinery::Setting.get(:gardenia_parts_sidebar)
    => "---\r\n- side_body\r\n- recent_posts\r\n- recent_news\r\n- widgets\r\n- body_content_right\r\n- daily_quotes" 

a string, not an array, is returned!

error when adding new setting value started with @

For example:
Try add:
Name: twitter
Value: @parndt

and this leads to:

Psych::SyntaxError in Refinery::Admin::SettingsController#create

(): found character that cannot start any token while scanning for the next token at line 1 column 1

branch: 2-0-stable

Not working for core config?

I have commented out config.site_name in the initializer, yet I'm still unable to set this through refinerycms-settings. Is this no longer supported?

deleted settings are cached in the front end until another setting is created

  1. Through the admin backend I create a setting call s1 and set it to true
  2. I look at <%= debug ::Refinery::Setting.get(:s1) %> and I get ---true ...so far so good
  3. I then delete the setting through the admin back end and reload the view and I still get ---true - even though looking at the refinery_settings table the record is gone, i've even tried restarting the rails server process
  4. If I then create a new arbitrary setting called something else and then reload the <%= debug ::Refinery::Setting.get(:s1) %> view, I now get --- !!null - which I was expecting in step 3

Undefined method `to_ruby' for #<Syck::Scalar...

Hi guys,

I'm getting the following error with 2.0.2 (not 2.0.1) when running an update on a setting on Heroku:

A NoMethodError occurred in settings#update:

  undefined method `to_ruby' for #<Syck::Scalar:0x0000000e705310>
  vendor/bundle/ruby/1.9.1/gems/refinerycms-settings-2.0.2/app/models/refinery/setting.rb:24:in `block in <class:Setting>'

Let me know if you need a further stack trace or anything.

Thanks!

setting name must be uri encoded in urls

for example setting property with name test/something has edit url
/refinery/settings/test/something/edit?app_dialog=true&dialog=true and that cause error:

 NoMethodError in Refinery::Admin::BaseController#error_404
undefined method `action' for Refinery::Admin::BaseController:Module

until restart server a new value will reflect

I have an issue when update a refinery settings value in admin page and it only reflects until restart server

  class AdminMailer < ApplicationMailer

  default to: "#{Refinery::Setting.find_or_set(:admin_email, "[email protected]", scoping: "mailer")}", from: "[email protected]"

  def notify_to_admin(email, saving_up_information)
    # code here
  end
end

my admin_email from default to always get old value so is there a way to take effect this change without restart server?

Unexpected writings with find_or_set

This is probably not the main usage for find_or_set but invoking

::Refinery::Setting.find_or_set(:setting_key, nil)

will issue a write operation on the database even if a setting exists for the provided key.

Putting the above find_or_set call in views will cause nested transactions that are not supported by some databases (eg. Sqlite3).

My suggestion is to rely on ::Refinery::Setting.find_or_create_by_name(key) when the value readed from cache and the value argument passed to find_or_set are both nil

Plaint seeds

I think a seed with the RefineryCMS configurable settings would be appreciated... to me, at least :)

version 2.1.0

When I used refinerycms-inquiries

I had to specify in my gemfile :
gem 'refinerycms-settings', :git => 'git://github.com/refinery/refinerycms-settings.git'

A version 2.1.0 should exist to be able to use :
gem 'refinerycms-settings', '~> 2.1.0'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.